Fix app state

This commit is contained in:
vvb2060 2022-06-26 16:21:20 +08:00 committed by John Wu
parent b4863eb51b
commit 38abad1e44

View File

@ -94,6 +94,7 @@ class HomeViewModel(
("${magisk.version} (${magisk.versionCode}) (${stub.versionCode})" +
if (isDebug) " (D)" else "").asText()
} ?: run {
appState = State.INVALID
managerRemoteVersion = R.string.not_available.asText()
}
ensureEnv()
@ -112,7 +113,7 @@ class HomeViewModel(
fun onDeletePressed() = UninstallDialog().publish()
fun onManagerPressed() = when (magiskState) {
fun onManagerPressed() = when (appState) {
State.LOADING -> SnackbarEvent(R.string.loading).publish()
State.INVALID -> SnackbarEvent(R.string.no_connection).publish()
else -> withExternalRW {