Fix selecting homepage

This commit is contained in:
Blatzar 2022-09-11 13:43:05 +02:00
parent 9c5f2ef2f1
commit 6f60298fc9

View file

@ -272,12 +272,13 @@ class HomeViewModel : ViewModel() {
if (!forceReload && api?.let { expandable[it.name]?.list?.list?.isNotEmpty() } == true) { if (!forceReload && api?.let { expandable[it.name]?.list?.list?.isNotEmpty() } == true) {
return@launchSafe return@launchSafe
} }
// If the plugin isn't loaded yet. (Does not set the key)
if (api == null) { if (preferredApiName == noneApi.name) {
loadAndCancel(noneApi)
} else if (preferredApiName == noneApi.name) {
setKey(USER_SELECTED_HOMEPAGE_API, noneApi.name) setKey(USER_SELECTED_HOMEPAGE_API, noneApi.name)
loadAndCancel(noneApi) loadAndCancel(noneApi)
// If the plugin isn't loaded yet. (Does not set the key)
} else if (api == null) {
loadAndCancel(noneApi)
} else if (preferredApiName == randomApi.name) { } else if (preferredApiName == randomApi.name) {
val validAPIs = context?.filterProviderByPreferredMedia() val validAPIs = context?.filterProviderByPreferredMedia()
if (validAPIs.isNullOrEmpty()) { if (validAPIs.isNullOrEmpty()) {