This commit is contained in:
Luna712 2024-07-24 15:17:55 -06:00 committed by GitHub
parent 78734fbb13
commit adad529949
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View file

@ -72,6 +72,14 @@ class DownloadChildFragment : Fragment() {
downloadsViewModel.setIsMultiDeleteState(false) downloadsViewModel.setIsMultiDeleteState(false)
} }
/**
* We have to make sure selected items are
* cleared here as well so we don't run in an
* inconsistent state where selected items do
* not match the multi delete state we are in.
*/
downloadsViewModel.clearSelectedItems()
val folder = arguments?.getString("folder") val folder = arguments?.getString("folder")
val name = arguments?.getString("name") val name = arguments?.getString("name")
if (folder == null) { if (folder == null) {

View file

@ -105,6 +105,14 @@ class DownloadFragment : Fragment() {
downloadsViewModel.setIsMultiDeleteState(false) downloadsViewModel.setIsMultiDeleteState(false)
} }
/**
* We have to make sure selected items are
* cleared here as well so we don't run in an
* inconsistent state where selected items do
* not match the multi delete state we are in.
*/
downloadsViewModel.clearSelectedItems()
observe(downloadsViewModel.headerCards) { observe(downloadsViewModel.headerCards) {
(binding?.downloadList?.adapter as? DownloadAdapter)?.submitList(it) (binding?.downloadList?.adapter as? DownloadAdapter)?.submitList(it)
binding?.downloadLoading?.isVisible = false binding?.downloadLoading?.isVisible = false