File tree 1 file changed +7
-2
lines changed
app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -361,14 +361,19 @@ class RefreshController @Inject constructor(
361
361
}
362
362
363
363
private fun updateFoldersUnreadCount (foldersIds : Set <String >, realm : MutableRealm ): Int? {
364
- return foldersIds.firstNotNullOfOrNull {
364
+
365
+ var inboxUnreadCount: Int? = null
366
+
367
+ foldersIds.forEach {
365
368
val folder = realm.getUpToDateFolder(it)
366
369
367
370
val unreadCount = ThreadController .getUnreadThreadsCount(folder)
368
371
folder.unreadCountLocal = unreadCount
369
372
370
- return @firstNotNullOfOrNull if (folder.role == FolderRole .INBOX ) unreadCount else null
373
+ if (folder.role == FolderRole .INBOX ) inboxUnreadCount = unreadCount
371
374
}
375
+
376
+ return inboxUnreadCount
372
377
}
373
378
374
379
private suspend fun updateMailboxUnreadCount (unreadCount : Int? ) {
You can’t perform that action at this time.
0 commit comments