disable automatic launch on error

This commit is contained in:
qimiko committed 2024-01-19 23:25:58 -07:00
1 parent 3e83bc8039
commit e7a3b72fad
1 file changed
+4 -2
@@ -70,7 +70,8 @@ class MainActivity : ComponentActivity() {
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background color = MaterialTheme.colorScheme.background
) { ) {
MainScreen(gdInstalled, geodeInstalled) val loadFailed = !returnMessage.isNullOrEmpty() && !returnTitle.isNullOrEmpty()
MainScreen(gdInstalled, geodeInstalled, loadFailed)
if (!returnMessage.isNullOrEmpty() && !returnTitle.isNullOrEmpty()) { if (!returnMessage.isNullOrEmpty() && !returnTitle.isNullOrEmpty()) {
LoadFailedDialog(returnTitle, returnMessage) LoadFailedDialog(returnTitle, returnMessage)
@@ -330,6 +331,7 @@ fun onSettings(context: Context) {
fun MainScreen( fun MainScreen(
gdInstalled: Boolean = true, gdInstalled: Boolean = true,
geodePreinstalled: Boolean = true, geodePreinstalled: Boolean = true,
disableAutomaticLaunch: Boolean = false,
releaseViewModel: ReleaseViewModel = viewModel(factory = ReleaseViewModel.Factory) releaseViewModel: ReleaseViewModel = viewModel(factory = ReleaseViewModel.Factory)
) { ) {
val context = LocalContext.current val context = LocalContext.current
@@ -375,7 +377,7 @@ fun MainScreen(
) )
if (gdInstalled && geodeInstalled) { if (gdInstalled && geodeInstalled) {
if (shouldAutomaticallyLaunch.value && !releaseViewModel.isInUpdate) { if (shouldAutomaticallyLaunch.value && !releaseViewModel.isInUpdate && !disableAutomaticLaunch) {
val countdownTimer = useCountdownTimer( val countdownTimer = useCountdownTimer(
time = 3000, time = 3000,
onCountdownFinish = { onCountdownFinish = {