mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-18 03:53:57 +00:00
fix: optimization # 1
This commit is contained in:
@@ -453,10 +453,12 @@ class HomeFragment : Fragment() {
|
||||
binding.homeUserStatusContainer,
|
||||
)
|
||||
|
||||
val live = Refresh.activity.getOrPut(1) { MutableLiveData(false) }
|
||||
var running = false
|
||||
val live = Refresh.activity.getOrPut(1) { MutableLiveData(true) }
|
||||
live.observe(viewLifecycleOwner)
|
||||
{
|
||||
if (it) {
|
||||
if (it && !running) {
|
||||
running = true
|
||||
scope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
//Get userData First
|
||||
@@ -483,6 +485,7 @@ class HomeFragment : Fragment() {
|
||||
_binding?.homeRefresh?.isRefreshing = false
|
||||
}
|
||||
binding.homeHiddenItemsContainer.visibility = View.GONE
|
||||
running = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user