🛠️ Fix no books can be added
* Fixed issue, where you can deselect item faster than open add dialog, resulting in empty list
This commit is contained in:
parent
0a3adf42f0
commit
1b0996b135
1 changed files with 9 additions and 0 deletions
|
|
@ -439,6 +439,15 @@ class BrowseViewModel @Inject constructor(
|
|||
val books = mutableListOf<NullableBook>()
|
||||
_state.value.selectableFiles
|
||||
.filter { it.isSelected && !it.isDirectory }
|
||||
.ifEmpty {
|
||||
_state.update {
|
||||
it.copy(
|
||||
isBooksLoading = false,
|
||||
showAddingDialog = false
|
||||
)
|
||||
}
|
||||
return@launch
|
||||
}
|
||||
.map { it.fileOrDirectory }
|
||||
.forEach {
|
||||
yield()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue