Commit 3f81f937 authored by vvb2060's avatar vvb2060 Committed by topjohnwu

Disable installation while downloading metadata

parent 60e89a7d
...@@ -125,14 +125,18 @@ class HomeViewModel( ...@@ -125,14 +125,18 @@ class HomeViewModel(
fun onDeletePressed() = UninstallDialog().publish() fun onDeletePressed() = UninstallDialog().publish()
fun onManagerPressed() = fun onManagerPressed() = when (state) {
if (isConnected.get()) ManagerInstallDialog().publish() State.LOADED -> ManagerInstallDialog().publish()
else SnackbarEvent(R.string.no_connection).publish() State.LOADING -> SnackbarEvent(R.string.loading).publish()
else -> SnackbarEvent(R.string.no_connection).publish()
fun onMagiskPressed() = if (isConnected.get()) withExternalRW { }
HomeFragmentDirections.actionHomeFragmentToInstallFragment().publish()
} else { fun onMagiskPressed() = when (state) {
SnackbarEvent(R.string.no_connection).publish() State.LOADED -> withExternalRW {
HomeFragmentDirections.actionHomeFragmentToInstallFragment().publish()
}
State.LOADING -> SnackbarEvent(R.string.loading).publish()
else -> SnackbarEvent(R.string.no_connection).publish()
} }
fun onSafetyNetPressed() = fun onSafetyNetPressed() =
......
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