Go to Unified Inbox when pressing back in message list

This commit is contained in:
cketti 2021-02-16 13:02:47 +01:00
parent 3457f69c56
commit 0121bab2e9

View file

@ -586,12 +586,20 @@ open class MessageList :
showMessageList()
} else {
if (isDrawerEnabled && account != null && supportFragmentManager.backStackEntryCount == 0) {
val defaultFolderId = defaultFolderProvider.getDefaultFolder(account!!)
val currentFolder = if (singleFolderMode) search!!.folderIds[0] else null
if (currentFolder == null || defaultFolderId != currentFolder) {
openFolderImmediately(defaultFolderId)
if (K9.isShowUnifiedInbox) {
if (search!!.id != SearchAccount.UNIFIED_INBOX) {
openUnifiedInbox()
} else {
super.onBackPressed()
}
} else {
super.onBackPressed()
val defaultFolderId = defaultFolderProvider.getDefaultFolder(account!!)
val currentFolder = if (singleFolderMode) search!!.folderIds[0] else null
if (currentFolder == null || defaultFolderId != currentFolder) {
openFolderImmediately(defaultFolderId)
} else {
super.onBackPressed()
}
}
} else {
super.onBackPressed()