Bug fix: contacts page infinite loading without internet
All checks were successful
Auto Tag on Version Change / check-version (push) Successful in 5s
All checks were successful
Auto Tag on Version Change / check-version (push) Successful in 5s
This commit is contained in:
@@ -48,7 +48,6 @@ class ContactsFragment : Fragment() {
|
||||
private var currentSearch: String = ""
|
||||
private var mediator: TabLayoutMediator? = null
|
||||
private lateinit var pagerAdapter: ContactsPagerAdapter
|
||||
private var contactsRefreshing = false
|
||||
|
||||
private data class TabPage(val categoryId: String?, val label: String)
|
||||
|
||||
@@ -136,8 +135,8 @@ class ContactsFragment : Fragment() {
|
||||
(activity as? HomeActivity)?.loadAllContacts()
|
||||
|
||||
binding.swipeRefresh.setOnRefreshListener {
|
||||
contactsRefreshing = true
|
||||
(activity as? HomeActivity)?.triggerRefresh()
|
||||
binding.swipeRefresh.isRefreshing = false
|
||||
}
|
||||
|
||||
viewModel.contactCategories.observe(viewLifecycleOwner) { cats ->
|
||||
@@ -149,10 +148,6 @@ class ContactsFragment : Fragment() {
|
||||
pagerAdapter.updateContacts(allContacts)
|
||||
binding.emptyView.visibility = if (contacts.isEmpty()) View.VISIBLE else View.GONE
|
||||
binding.loadingView.visibility = View.GONE
|
||||
if (contactsRefreshing) {
|
||||
contactsRefreshing = false
|
||||
binding.swipeRefresh.isRefreshing = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ class FinancingFragment : Fragment() {
|
||||
private val binding get() = _binding!!
|
||||
private val viewModel: HomeViewModel by activityViewModels()
|
||||
private lateinit var adapter: FinancingAdapter
|
||||
private var financingRefreshing = false
|
||||
|
||||
private var latestMibDeals: List<MibFinanceDeal> = emptyList()
|
||||
private var latestBmlLoanDetails: Map<String, BmlLoanDetail> = emptyMap()
|
||||
@@ -46,8 +45,8 @@ class FinancingFragment : Fragment() {
|
||||
}
|
||||
|
||||
binding.swipeRefresh.setOnRefreshListener {
|
||||
financingRefreshing = true
|
||||
(activity as? HomeActivity)?.triggerRefresh()
|
||||
binding.swipeRefresh.isRefreshing = false
|
||||
}
|
||||
|
||||
viewModel.accounts.observe(viewLifecycleOwner) { rebuildAdapter() }
|
||||
@@ -74,10 +73,6 @@ class FinancingFragment : Fragment() {
|
||||
binding.recyclerView.visibility = if (isEmpty) View.GONE else View.VISIBLE
|
||||
binding.emptyView.visibility = if (isEmpty) View.VISIBLE else View.GONE
|
||||
binding.loadingView.visibility = View.GONE
|
||||
if (financingRefreshing) {
|
||||
financingRefreshing = false
|
||||
binding.swipeRefresh.isRefreshing = false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
||||
Reference in New Issue
Block a user