Skip to content

Commit 3156182

Browse files
committed
refactor(app): ignore already read notifications
- Add a check to skip updating notifications that are already marked as read - This optimization prevents unnecessary database operations and ensures - more accurate tracking of unread notifications
1 parent 9534e11 commit 3156182

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/app/bloc/app_bloc.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,9 @@ class AppBloc extends Bloc<AppEvent, AppState> {
702702
userId: userId,
703703
);
704704

705+
// If already read, do nothing.
706+
if (notification.isRead) return;
707+
705708
// Then, update it with the 'readAt' timestamp.
706709
await _inAppNotificationRepository.update(
707710
id: notification.id,

0 commit comments

Comments
 (0)