diff --git a/app/src/main/java/com/infomaniak/mail/MainApplication.kt b/app/src/main/java/com/infomaniak/mail/MainApplication.kt index 231bc3eaee..7c941660ad 100644 --- a/app/src/main/java/com/infomaniak/mail/MainApplication.kt +++ b/app/src/main/java/com/infomaniak/mail/MainApplication.kt @@ -170,7 +170,7 @@ open class MainApplication : Application(), ImageLoaderFactory, DefaultLifecycle val shouldLog = mutableListOf() - // Sentry events are discarded is the app is in Debug mode + // Sentry events are discarded if the app is in Debug mode val isInReleaseMode = !BuildConfig.DEBUG shouldLog.add(isInReleaseMode) diff --git a/app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/ThreadController.kt b/app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/ThreadController.kt index 670910d7b8..e26f8c46ad 100644 --- a/app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/ThreadController.kt +++ b/app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/ThreadController.kt @@ -402,15 +402,14 @@ class ThreadController @Inject constructor( suspend fun deleteEmptyThreadsInFolder(folderId: String, realm: Realm) { realm.write { - val emptyThreadsQuery = getEmptyThreadsInFolderQuery(folderId, realm = this) - val emptyThreads = emptyThreadsQuery.find() + val emptyThreads = getEmptyThreadsInFolderQuery(folderId, realm = this).find() // TODO: Find why we are sometimes displaying empty Threads, and fix it instead of just deleting them. // It's possibly because we are out of sync, and the situation will resolve by itself shortly? if (emptyThreads.isNotEmpty()) { emptyThreads.forEach { SentryDebug.sendEmptyThread(it, "No Message in a Thread when refreshing a Folder", realm = this) } - delete(emptyThreadsQuery) + delete(emptyThreads) } } }