TF-3385 Fix mark as read not work properly

This commit is contained in:
DatDang
2025-01-03 15:12:53 +07:00
committed by Dat H. Pham
parent 6396b50bc9
commit 3541ac085e
6 changed files with 50 additions and 29 deletions
@@ -281,25 +281,29 @@ class MailboxController extends BaseMailboxController
: null,
);
} else if (reactionState is MarkAsMultipleEmailReadAllSuccess) {
_handleMarkEmailsAsReadOrUnread(
affectedMailboxId: reactionState.mailboxId,
readCount: reactionState.readActions == ReadActions.markAsRead
? reactionState.emailIds.length
: null,
unreadCount: reactionState.readActions == ReadActions.markAsUnread
? reactionState.emailIds.length
: null,
);
for (var emailIdsByMailboxId in reactionState.markSuccessEmailIdsByMailboxId.entries) {
_handleMarkEmailsAsReadOrUnread(
affectedMailboxId: emailIdsByMailboxId.key,
readCount: reactionState.readActions == ReadActions.markAsRead
? emailIdsByMailboxId.value.length
: null,
unreadCount: reactionState.readActions == ReadActions.markAsUnread
? emailIdsByMailboxId.value.length
: null,
);
}
} else if (reactionState is MarkAsMultipleEmailReadHasSomeEmailFailure) {
_handleMarkEmailsAsReadOrUnread(
affectedMailboxId: reactionState.mailboxId,
readCount: reactionState.readActions == ReadActions.markAsRead
? reactionState.successEmailIds.length
: null,
unreadCount: reactionState.readActions == ReadActions.markAsUnread
? reactionState.successEmailIds.length
: null,
);
for (var emailIdsByMailboxId in reactionState.markSuccessEmailIdsByMailboxId.entries) {
_handleMarkEmailsAsReadOrUnread(
affectedMailboxId: emailIdsByMailboxId.key,
readCount: reactionState.readActions == ReadActions.markAsRead
? emailIdsByMailboxId.value.length
: null,
unreadCount: reactionState.readActions == ReadActions.markAsUnread
? emailIdsByMailboxId.value.length
: null,
);
}
} else if (reactionState is MarkAsMailboxReadAllSuccess) {
_handleMarkMailboxAsRead(
affectedMailboxId: reactionState.mailboxId,