diff --git a/lib/inbox/bloc/inbox_bloc.dart b/lib/inbox/bloc/inbox_bloc.dart index 853bee580..f5cd9f364 100644 --- a/lib/inbox/bloc/inbox_bloc.dart +++ b/lib/inbox/bloc/inbox_bloc.dart @@ -107,6 +107,34 @@ class InboxBloc extends Bloc { ), ); break; + case InboxType.all: + getRepliesResponse = await lemmy.run( + GetReplies( + auth: account!.jwt!, + unreadOnly: !event.showAll, + limit: limit, + sort: CommentSortType.new_, + page: 1, + ), + ); + getPersonMentionsResponse = await lemmy.run( + GetPersonMentions( + auth: account.jwt!, + unreadOnly: !event.showAll, + sort: CommentSortType.new_, + limit: limit, + page: 1, + ), + ); + privateMessagesResponse = await lemmy.run( + GetPrivateMessages( + auth: account.jwt!, + unreadOnly: !event.showAll, + limit: limit, + page: 1, + ), + ); + break; default: break; } diff --git a/lib/inbox/enums/inbox_type.dart b/lib/inbox/enums/inbox_type.dart index abf892a42..d64d3784f 100644 --- a/lib/inbox/enums/inbox_type.dart +++ b/lib/inbox/enums/inbox_type.dart @@ -1 +1 @@ -enum InboxType { replies, mentions, messages } +enum InboxType { replies, mentions, messages, all } diff --git a/lib/notification/utils/navigate_notification.dart b/lib/notification/utils/navigate_notification.dart index 25d6155e3..a386a8508 100644 --- a/lib/notification/utils/navigate_notification.dart +++ b/lib/notification/utils/navigate_notification.dart @@ -15,6 +15,7 @@ import 'package:thunder/core/auth/bloc/auth_bloc.dart'; import 'package:thunder/core/auth/helpers/fetch_account.dart'; import 'package:thunder/core/singletons/lemmy_client.dart'; import 'package:thunder/inbox/bloc/inbox_bloc.dart'; +import 'package:thunder/inbox/enums/inbox_type.dart'; import 'package:thunder/shared/pages/loading_page.dart'; import 'package:thunder/thunder/bloc/thunder_bloc.dart'; import 'package:thunder/thunder/pages/notifications_pages.dart'; @@ -90,8 +91,6 @@ void navigateToNotificationReplyPage(BuildContext context, {required int? replyI ); pushOnTopOfLoadingPage(context, route).then((_) { - context.read().add(const GetInboxEvent(reset: true)); - // If needed, switch back to the original account or anonymous instance if (switchedAccount) { if (originalAccount != null) { @@ -104,6 +103,8 @@ void navigateToNotificationReplyPage(BuildContext context, {required int? replyI context.read().add(InstanceChanged(instance: originalAnonymousInstance)); } } + + context.read().add(const GetInboxEvent(reset: true, inboxType: InboxType.all)); }); } }