Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/cubits/comments/comments_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ class CommentsCubit extends Cubit<CommentsState> with Loggable, BuildableMixin {
cmt.copyWith(level: level),
),
idToCommentMap: updatedIdToCommentMap,
maxLevel: state.maxLevel < level ? level : null,
),
);
offset++;
Expand Down
2 changes: 2 additions & 0 deletions lib/extensions/item_action_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ mixin ItemActionMixin<T extends StatefulWidget> on State<T> {
required String content,
VoidCallback? action,
String? label,
bool? persist,
}) {
context.showSnackBar(
content: content,
action: action,
label: label,
persist: persist,
);
}

Expand Down
34 changes: 14 additions & 20 deletions lib/screens/item/item_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:hacki/extensions/extensions.dart';
import 'package:hacki/models/models.dart';
import 'package:hacki/repositories/repositories.dart';
import 'package:hacki/screens/item/widgets/widgets.dart';
import 'package:hacki/screens/widgets/widgets.dart';
import 'package:hacki/screens/widgets/download_progress_reminder.dart';
import 'package:hacki/services/services.dart';
import 'package:hacki/styles/styles.dart';
import 'package:hacki/utils/utils.dart';
Expand Down Expand Up @@ -81,25 +81,10 @@ class ItemScreen extends StatefulWidget {
),
),
],
child: Stack(
children: <Widget>[
Positioned.fill(
child: ItemScreen(
item: args.item,
parentComments: args.targetComments ?? <Comment>[],
shouldMarkNewComment: args.shouldMarkNewComment,
),
),
const Positioned(
left: Dimens.zero,
right: Dimens.zero,
bottom: Dimens.zero,
height: Dimens.pt40,
child: DownloadProgressReminder(
isDockedAtBottom: true,
),
),
],
child: ItemScreen(
item: args.item,
parentComments: args.targetComments ?? <Comment>[],
shouldMarkNewComment: args.shouldMarkNewComment,
),
);
}
Expand Down Expand Up @@ -442,6 +427,15 @@ class _ItemScreenState extends State<ItemScreen>
bottom: Dimens.pt48,
child: FloatingSkipButtons(),
),
const Positioned(
left: Dimens.zero,
right: Dimens.zero,
bottom: Dimens.zero,
height: Dimens.pt40,
child: DownloadProgressReminder(
isDockedAtBottom: true,
),
),
],
),
bottomSheet: ReplyBox(
Expand Down
4 changes: 3 additions & 1 deletion lib/screens/item/widgets/item_screen_background.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class _ItemScreenBackgroundState extends State<ItemScreenBackground> {
previous.maxLevel != current.maxLevel ||
previous.status != current.status,
builder: (BuildContext context, CommentsState state) {
if (!_isVisible) return const SizedBox.shrink();
if (!_isVisible || state.status == CommentsStatus.inProgress) {
return const SizedBox.shrink();
}
return FadeIn(
child: Stack(
children: <Widget>[
Expand Down
1 change: 1 addition & 0 deletions lib/screens/item/widgets/main_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ class MainView extends StatelessWidget {
HapticFeedbackUtils.error();
context.showSnackBar(
content: SnackBarMessages.notLoggedInNoVoting,
persist: false,
action: () {
showDialog<void>(
context: context,
Expand Down
1 change: 1 addition & 0 deletions lib/screens/item/widgets/more_popup_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class MorePopupMenu extends StatelessWidget {
} else if (voteState.status == VoteStatus.failureNotLoggedIn) {
context.showSnackBar(
content: SnackBarMessages.notLoggedInNoVoting,
persist: false,
action: onLoginTapped,
label: 'Log in',
);
Expand Down
1 change: 1 addition & 0 deletions lib/screens/item/widgets/poll_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class _PollViewState extends State<PollView> with ItemActionMixin {
VoteStatus.failureNotLoggedIn) {
showSnackBar(
content: SnackBarMessages.notLoggedInNoVoting,
persist: false,
action: onLoginTapped,
label: 'Log in',
);
Expand Down