fixup! Initial support for caching updates
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -108,7 +108,11 @@ class UpdatesFragment : BaseFragment<FragmentUpdatesBinding>() {
|
|||||||
viewLifecycleOwner.lifecycleScope.launch {
|
viewLifecycleOwner.lifecycleScope.launch {
|
||||||
viewModel.fetchingUpdates.collect {
|
viewModel.fetchingUpdates.collect {
|
||||||
binding.swipeRefreshLayout.isRefreshing = it
|
binding.swipeRefreshLayout.isRefreshing = it
|
||||||
if (it && viewModel.updates.value.isNullOrEmpty()) updateController(null)
|
if (it && viewModel.updates.value.isNullOrEmpty()) {
|
||||||
|
updateController(null)
|
||||||
|
} else {
|
||||||
|
updateController(emptyMap())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user