diff --git a/app/src/main/java/foundation/e/apps/updates/UpdatesFragment.kt b/app/src/main/java/foundation/e/apps/updates/UpdatesFragment.kt index 68016394af2a17f1b2919c12d7cbfb45c2a96a1e..7c1f38b76e7d3a0cf9c37dd65033f3863b13436b 100644 --- a/app/src/main/java/foundation/e/apps/updates/UpdatesFragment.kt +++ b/app/src/main/java/foundation/e/apps/updates/UpdatesFragment.kt @@ -144,10 +144,12 @@ class UpdatesFragment : TimeoutFragment(R.layout.fragment_updates), FusedAPIInte } WorkManager.getInstance(requireContext()) - .getWorkInfosForUniqueWorkLiveData(INSTALL_WORK_NAME).observe(viewLifecycleOwner) { + .getWorkInfosForUniqueWorkLiveData(INSTALL_WORK_NAME).observe(viewLifecycleOwner) { workInfoList -> lifecycleScope.launchWhenResumed { - binding.button.isEnabled = - !updatesViewModel.checkWorkInfoListHasAnyUpdatableWork(it) + binding.button.isEnabled = !( + it.first.isNullOrEmpty() || + updatesViewModel.checkWorkInfoListHasAnyUpdatableWork(workInfoList) + ) } }