Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac93b044 authored by Hasib Prince's avatar Hasib Prince
Browse files

fixed: disable update all button on no updates

parent c5d9477c
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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)
                            )
                    }
                }