mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Reload library when reloading home (#656)
So that library is reloaded when switching accounts. Fixes #650
This commit is contained in:
parent
177b1e47f3
commit
0a327ccbda
2 changed files with 10 additions and 1 deletions
|
@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import com.lagradost.cloudstream3.AcraApplication.Companion.getKey
|
import com.lagradost.cloudstream3.AcraApplication.Companion.getKey
|
||||||
import com.lagradost.cloudstream3.AcraApplication.Companion.setKey
|
import com.lagradost.cloudstream3.AcraApplication.Companion.setKey
|
||||||
|
import com.lagradost.cloudstream3.MainActivity
|
||||||
import com.lagradost.cloudstream3.R
|
import com.lagradost.cloudstream3.R
|
||||||
import com.lagradost.cloudstream3.mvvm.Resource
|
import com.lagradost.cloudstream3.mvvm.Resource
|
||||||
import com.lagradost.cloudstream3.syncproviders.AccountManager.Companion.SyncApis
|
import com.lagradost.cloudstream3.syncproviders.AccountManager.Companion.SyncApis
|
||||||
|
@ -101,4 +102,13 @@ class LibraryViewModel : ViewModel() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
MainActivity.reloadHomeEvent += ::reloadPages
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCleared() {
|
||||||
|
MainActivity.reloadHomeEvent -= ::reloadPages
|
||||||
|
super.onCleared()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -131,7 +131,6 @@ object DataStoreHelper {
|
||||||
|
|
||||||
// update UI
|
// update UI
|
||||||
setAccount(getDefaultAccount(context), true)
|
setAccount(getDefaultAccount(context), true)
|
||||||
MainActivity.bookmarksUpdatedEvent(true)
|
|
||||||
dialog?.dismissSafe()
|
dialog?.dismissSafe()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue