Commit 38abad1e authored by vvb2060's avatar vvb2060 Committed by John Wu

Fix app state

parent b4863eb5
...@@ -94,6 +94,7 @@ class HomeViewModel( ...@@ -94,6 +94,7 @@ class HomeViewModel(
("${magisk.version} (${magisk.versionCode}) (${stub.versionCode})" + ("${magisk.version} (${magisk.versionCode}) (${stub.versionCode})" +
if (isDebug) " (D)" else "").asText() if (isDebug) " (D)" else "").asText()
} ?: run { } ?: run {
appState = State.INVALID
managerRemoteVersion = R.string.not_available.asText() managerRemoteVersion = R.string.not_available.asText()
} }
ensureEnv() ensureEnv()
...@@ -112,7 +113,7 @@ class HomeViewModel( ...@@ -112,7 +113,7 @@ class HomeViewModel(
fun onDeletePressed() = UninstallDialog().publish() fun onDeletePressed() = UninstallDialog().publish()
fun onManagerPressed() = when (magiskState) { fun onManagerPressed() = when (appState) {
State.LOADING -> SnackbarEvent(R.string.loading).publish() State.LOADING -> SnackbarEvent(R.string.loading).publish()
State.INVALID -> SnackbarEvent(R.string.no_connection).publish() State.INVALID -> SnackbarEvent(R.string.no_connection).publish()
else -> withExternalRW { else -> withExternalRW {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment