forked from geode-sdk/android-launcher
fix restarting after rotation
This commit is contained in:
2 files changed
+6
-2
No files matched your search
@@ -466,7 +466,7 @@ fun AltMainScreen(
|
|||||||
|
|
||||||
launchViewModel.clearCrashInfo()
|
launchViewModel.clearCrashInfo()
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
launchViewModel.beginLaunchFlow()
|
launchViewModel.beginLaunchFlow(true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onMore = {
|
onMore = {
|
||||||
|
|||||||
@@ -157,11 +157,15 @@ class LaunchViewModel(private val application: Application): ViewModel() {
|
|||||||
_uiState.emit(LaunchUIState.Ready)
|
_uiState.emit(LaunchUIState.Ready)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun beginLaunchFlow() {
|
suspend fun beginLaunchFlow(isRestart: Boolean = false) {
|
||||||
if (_uiState.value !is LaunchUIState.Initial && _uiState.value !is LaunchUIState.Cancelled) {
|
if (_uiState.value !is LaunchUIState.Initial && _uiState.value !is LaunchUIState.Cancelled) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_uiState.value is LaunchUIState.Cancelled && !isRestart) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
isCancelling = false
|
isCancelling = false
|
||||||
|
|
||||||
if (!GamePackageUtils.isGameInstalled(application.packageManager)) {
|
if (!GamePackageUtils.isGameInstalled(application.packageManager)) {
|
||||||
|
|||||||
Reference in new issue
Block a user