mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-06-29 02:26:05 +01:00
Skip per-folder unread queries when only the default chat folder exists.
This commit is contained in:
+6
-1
@@ -217,7 +217,12 @@ sealed class ConversationListViewModel(
|
||||
private fun loadCurrentFolders() {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val folders = ChatFoldersRepository.getCurrentFolders()
|
||||
val unreadCountAndEmptyAndMutedStatus = ChatFoldersRepository.getUnreadCountAndEmptyAndMutedStatusForFolders(folders)
|
||||
|
||||
val unreadCountAndEmptyAndMutedStatus: Map<Long, Triple<Int, Boolean, Boolean>> = if (folders.size > 1) {
|
||||
ChatFoldersRepository.getUnreadCountAndEmptyAndMutedStatusForFolders(folders)
|
||||
} else {
|
||||
emptyMap()
|
||||
}
|
||||
|
||||
val selectedFolderId = if (currentFolder.id == -1L) {
|
||||
folders.firstOrNull()?.id
|
||||
|
||||
Reference in New Issue
Block a user