clear logs after clicking the finish button

This commit is contained in:
X1nto 2021-11-29 19:45:40 +04:00
parent ff510d7ce0
commit 275597629e
2 changed files with 6 additions and 5 deletions

View File

@ -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)
} }
) )

View File

@ -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
}
} }