Fix: Updating AppSheet state on download finished

This commit is contained in:
machiav3lli 2022-05-31 03:20:11 +02:00
parent 3e623eac3b
commit db5b22f5cf

View File

@ -257,8 +257,8 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
} }
val downloading = status is Cancelable val downloading = status is Cancelable
this.downloading = downloading this.downloading = downloading
viewModel.state.value = state
updateButtons() updateButtons()
viewModel.state.value = status
if (state is DownloadService.State.Success && isResumed && !rootInstallerEnabled) { if (state is DownloadService.State.Success && isResumed && !rootInstallerEnabled) {
withContext(Dispatchers.Default) { withContext(Dispatchers.Default) {
AppInstaller.getInstance(context)?.defaultInstaller?.install(state.release.cacheFileName) AppInstaller.getInstance(context)?.defaultInstaller?.install(state.release.cacheFileName)