mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-28 22:27:28 +00:00
Added handling for state with no connection
This commit is contained in:
@@ -54,6 +54,7 @@ class HomeViewModel(
|
||||
}
|
||||
|
||||
override fun refresh() = repoMagisk.fetchUpdate()
|
||||
.onErrorReturn { Info.remote }
|
||||
.subscribeK { updateBy(it) }
|
||||
|
||||
private fun updateBy(info: UpdateInfo) {
|
||||
@@ -64,7 +65,7 @@ class HomeViewModel(
|
||||
}
|
||||
|
||||
stateManager.value = when {
|
||||
!info.app.isUpdateChannelCorrect -> MagiskState.NOT_INSTALLED
|
||||
!info.app.isUpdateChannelCorrect && isConnected.value -> MagiskState.NOT_INSTALLED
|
||||
info.app.isObsolete -> MagiskState.OBSOLETE
|
||||
else -> MagiskState.UP_TO_DATE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user