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

Commit d8899787 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

issue_5413_2: set update data if ResultStatus is OK, else show timeout dialog...

issue_5413_2: set update data if ResultStatus is OK, else show timeout dialog and don't do anything else.
parent 9520677c
Loading
Loading
Loading
Loading
+22 −21
Original line number Diff line number Diff line
@@ -129,13 +129,16 @@ class UpdatesFragment : TimeoutFragment(R.layout.fragment_updates), FusedAPIInte
        }

        updatesViewModel.updatesList.observe(viewLifecycleOwner) {
            if (it.second != ResultStatus.OK) {
                onTimeout()
                return@observe
            } else {
                listAdapter?.setData(it.first)
                if (!isDownloadObserverAdded) {
                    observeDownloadList()
                    isDownloadObserverAdded = true
                }
            stopLoadingUI()
            if (!it.first.isNullOrEmpty()) {
                if (it.first.isNotEmpty()) {
                    binding.button.isEnabled = true
                    binding.noUpdates.visibility = View.GONE
                } else {
@@ -150,10 +153,8 @@ class UpdatesFragment : TimeoutFragment(R.layout.fragment_updates), FusedAPIInte
                                !updatesViewModel.checkWorkInfoListHasAnyUpdatableWork(it)
                        }
                    }

            if (it.second != ResultStatus.OK) {
                onTimeout()
            }
            stopLoadingUI()
        }
    }