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

Verified Commit 9de9696b authored by Fahim M. Choudhury's avatar Fahim M. Choudhury
Browse files

fix(updates): show empty state after refresh

Use displayedUpdates instead of the adapter item count when deciding whether to show the 'All apps are up-to-date' state. submitList updates the adapter asynchronously, so itemCount could stay stale until the fragment was reopened.
parent cd7630e9
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -409,7 +409,7 @@ class UpdatesFragment : TimeoutFragment(R.layout.fragment_updates), ApplicationI
    override fun stopLoadingUI() {
        binding.progressBar.visibility = View.GONE

        if ((binding.recyclerView.adapter?.itemCount ?: 0) > 0) {
        if (displayedUpdates.isNotEmpty()) {
            binding.noUpdates.visibility = View.GONE
            binding.recyclerView.visibility = View.VISIBLE
            return