TF-3385 Optimize misc

This commit is contained in:
DatDang
2025-01-03 17:00:16 +07:00
committed by Dat H. Pham
parent 0248b9138c
commit ee63f239e7
4 changed files with 37 additions and 30 deletions
@@ -244,19 +244,21 @@ class MailboxRepositoryImpl extends MailboxRepository {
totalEmailUnread,
onProgressController);
try {
await mapDataSource[DataSourceType.local]!.markAsMailboxRead(
session,
accountId,
mailboxId,
totalEmailUnread - result.length,
onProgressController,
);
await emailDataSource?.markAsRead(
session,
accountId,
result,
ReadActions.markAsRead,
);
await Future.wait([
mapDataSource[DataSourceType.local]!.markAsMailboxRead(
session,
accountId,
mailboxId,
totalEmailUnread - result.length,
onProgressController,
),
emailDataSource?.markAsRead(
session,
accountId,
result,
ReadActions.markAsRead,
) ?? Future.value(),
]);
} catch (e) {
logError('MailboxRepositoryImpl::markAsMailboxRead: Exception: $e');
}