diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt index 1e8028531..938eb1321 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt @@ -80,7 +80,7 @@ class HomeViewModel( it.bindExtra(BR.viewModel, this) } - private var shownDialog = false + private var checkedEnv = false override fun refresh() = viewModelScope.launch { state = State.LOADING @@ -136,12 +136,12 @@ class HomeViewModel( } private suspend fun ensureEnv() { - if (MagiskState.NOT_INSTALLED == stateMagisk || shownDialog) return + if (MagiskState.NOT_INSTALLED == stateMagisk || checkedEnv) return val cmd = "env_check ${Info.env.versionString} ${Info.env.versionCode}" if (!Shell.su(cmd).await().isSuccess) { - shownDialog = true EnvFixDialog(this).publish() } + checkedEnv = true } }