Sort list of folders in account settings
This commit is contained in:
parent
3665deef61
commit
e71b4bcb90
1 changed files with 5 additions and 0 deletions
|
@ -70,6 +70,11 @@ class AccountSettingsViewModel(
|
|||
viewModelScope.launch {
|
||||
val remoteFolderInfo = withContext(backgroundDispatcher) {
|
||||
val folders = folderRepository.getRemoteFolders(account)
|
||||
.sortedWith(
|
||||
compareByDescending<RemoteFolder> { it.type == FolderType.INBOX }
|
||||
.thenBy(String.CASE_INSENSITIVE_ORDER) { it.name }
|
||||
)
|
||||
|
||||
val automaticSpecialFolders = getAutomaticSpecialFolders(folders)
|
||||
RemoteFolderInfo(folders, automaticSpecialFolders)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue