Merge pull request #7445 from thunderbird/special_folders_fix_2
Sort folders alphabetically in special folders screen
This commit is contained in:
commit
d3c7ec39aa
2 changed files with 11 additions and 7 deletions
|
@ -24,6 +24,10 @@ class GetSpecialFolderOptions(
|
|||
?: error("No incoming server settings available")
|
||||
|
||||
val remoteFolders = folderFetcher.getFolders(serverSettings, authStateStorage)
|
||||
.sortedWith(
|
||||
compareByDescending<RemoteFolder> { it.type == FolderType.INBOX }
|
||||
.thenBy(String.CASE_INSENSITIVE_ORDER) { it.displayName },
|
||||
)
|
||||
|
||||
SpecialFolderOptions(
|
||||
archiveSpecialFolderOptions = mapByFolderType(FolderType.ARCHIVE, remoteFolders),
|
||||
|
|
|
@ -124,31 +124,31 @@ class GetSpecialFolderOptionsTest {
|
|||
|
||||
assertThat(folders.archiveSpecialFolderOptions[0]).isEqualTo(
|
||||
SpecialFolderOption.Special(
|
||||
remoteFolder = ARCHIVE_FOLDER_2,
|
||||
remoteFolder = ARCHIVE_FOLDER_1,
|
||||
isAutomatic = true,
|
||||
),
|
||||
)
|
||||
assertThat(folders.draftsSpecialFolderOptions[0]).isEqualTo(
|
||||
SpecialFolderOption.Special(
|
||||
remoteFolder = DRAFTS_FOLDER_2,
|
||||
remoteFolder = DRAFTS_FOLDER_1,
|
||||
isAutomatic = true,
|
||||
),
|
||||
)
|
||||
assertThat(folders.sentSpecialFolderOptions[0]).isEqualTo(
|
||||
SpecialFolderOption.Special(
|
||||
remoteFolder = SENT_FOLDER_2,
|
||||
remoteFolder = SENT_FOLDER_1,
|
||||
isAutomatic = true,
|
||||
),
|
||||
)
|
||||
assertThat(folders.spamSpecialFolderOptions[0]).isEqualTo(
|
||||
SpecialFolderOption.Special(
|
||||
remoteFolder = SPAM_FOLDER_2,
|
||||
remoteFolder = SPAM_FOLDER_1,
|
||||
isAutomatic = true,
|
||||
),
|
||||
)
|
||||
assertThat(folders.trashSpecialFolderOptions[0]).isEqualTo(
|
||||
SpecialFolderOption.Special(
|
||||
remoteFolder = TRASH_FOLDER_2,
|
||||
remoteFolder = TRASH_FOLDER_1,
|
||||
isAutomatic = true,
|
||||
),
|
||||
)
|
||||
|
@ -299,6 +299,8 @@ class GetSpecialFolderOptionsTest {
|
|||
SpecialFolderOption.Special(
|
||||
remoteFolder = DRAFTS_FOLDER_1,
|
||||
),
|
||||
SpecialFolderOption.Regular(REGULAR_FOLDER_1),
|
||||
SpecialFolderOption.Regular(REGULAR_FOLDER_2),
|
||||
SpecialFolderOption.Special(
|
||||
remoteFolder = SENT_FOLDER_1,
|
||||
),
|
||||
|
@ -308,8 +310,6 @@ class GetSpecialFolderOptionsTest {
|
|||
SpecialFolderOption.Special(
|
||||
remoteFolder = TRASH_FOLDER_1,
|
||||
),
|
||||
SpecialFolderOption.Regular(REGULAR_FOLDER_1),
|
||||
SpecialFolderOption.Regular(REGULAR_FOLDER_2),
|
||||
).toTypedArray()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue