clear logs after clicking the finish button
This commit is contained in:
parent
ff510d7ce0
commit
275597629e
|
@ -140,6 +140,7 @@ class MainActivity : ComponentActivity() {
|
||||||
appVersions = screen.appVersions,
|
appVersions = screen.appVersions,
|
||||||
viewModel = installViewModel,
|
viewModel = installViewModel,
|
||||||
onFinishClick = {
|
onFinishClick = {
|
||||||
|
installViewModel.clear()
|
||||||
backStack.newRoot(Screen.Home)
|
backStack.newRoot(Screen.Home)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -74,6 +74,11 @@ class InstallViewModel(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun clear() {
|
||||||
|
logs.clear()
|
||||||
|
status = Status.Idle
|
||||||
|
}
|
||||||
|
|
||||||
private suspend fun downloadApp(
|
private suspend fun downloadApp(
|
||||||
appName: String,
|
appName: String,
|
||||||
appVersions: List<String>?,
|
appVersions: List<String>?,
|
||||||
|
@ -132,9 +137,4 @@ class InstallViewModel(
|
||||||
logs.add(data)
|
logs.add(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun clear() {
|
|
||||||
logs.clear()
|
|
||||||
status = Status.Idle
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue