Use the inbox for the auto-expand folder by default
@@ -11,8 +11,11 @@ class AutoExpandFolderBackendFoldersRefreshListener(
private val account: Account,
private val folderRepository: FolderRepository
) : BackendFoldersRefreshListener {
+ private var isFirstSync = false
- override fun onBeforeFolderListRefresh() = Unit
+ override fun onBeforeFolderListRefresh() {
+ isFirstSync = account.inboxFolderId == null
+ }
override fun onAfterFolderListRefresh() {
checkAutoExpandFolder()
@@ -33,6 +36,10 @@ class AutoExpandFolderBackendFoldersRefreshListener(
account.autoExpandFolderId = null
}
}
+
+ if (isFirstSync && account.autoExpandFolderId == null) {
+ account.autoExpandFolderId = account.inboxFolderId
+ }
}
private fun removeImportedAutoExpandFolder() {
