improve: toggle selection mode when last item is unselected

This commit is contained in:
Cuong M. Tran 2024-03-07 13:18:35 +07:00 committed by Cuong Tran
parent 0ad2680b45
commit 42022bf661
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2
2 changed files with 6 additions and 0 deletions

View file

@ -473,6 +473,9 @@ open class BrowseSourceScreenModel(
}
}
state.copy(selection = newSelection)
}.also {
if (state.value.selection.isEmpty())
toggleSelectionMode()
}
}

View file

@ -249,6 +249,9 @@ abstract class SearchScreenModel(
}
}
state.copy(selection = newSelection)
}.also {
if (state.value.selection.isEmpty())
toggleSelectionMode()
}
}