Only monitor when necessary

This commit is contained in:
Mygod
2020-06-28 11:09:54 -04:00
parent 027a954e1d
commit 91c318fa90
3 changed files with 12 additions and 9 deletions

View File

@@ -225,7 +225,7 @@ class ClientsFragment : Fragment() {
binding.swipeRefresher.setColorSchemeResources(R.color.colorSecondary)
binding.swipeRefresher.setOnRefreshListener { IpNeighbourMonitor.instance?.flushAsync() }
activityViewModels<ClientViewModel>().value.apply {
lifecycle.addObserver(this)
lifecycle.addObserver(fullMode)
clients.observe(viewLifecycleOwner) { adapter.submitList(it.toMutableList()) }
}
return binding.root