From 01309c241d884549aeb48613078915c35a4a1ef9 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Thu, 2 Jul 2026 20:11:21 +0300 Subject: [PATCH] Prevent un-necessary config save and restart alert in settings screen --- app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt index 56b21596..543c5d52 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/SettingsScreen.kt @@ -152,6 +152,8 @@ private fun SettingsScreen( } LaunchedEffect(null) { + save = false + restart = false settingsViewModel.loadSettings(ctx) areSettingsLoaded = true } @@ -191,7 +193,7 @@ private fun SettingsScreen( } ) { contentPadding -> - if (showRestartDialog.value) { + if (showRestartDialog.value) AlertDialog( showDialog = showRestartDialog, title = stringResource(R.string.restart_request), @@ -201,7 +203,6 @@ private fun SettingsScreen( lastButtonText = stringResource(R.string.restart), onLastClicked = { onRestartApp() }, ) - } if (areSettingsLoaded && activity != null) SettingsContent(settingsViewModel, contentPadding, navController, activity, onRestartApp) @@ -264,7 +265,7 @@ private fun SettingsContent( val okButtonText = stringResource(R.string.ok) val cancelButtonText = stringResource(R.string.cancel) - if (showAlert.value) { + if (showAlert.value) AlertDialog( showDialog = showAlert, title = alertTitle.value, @@ -272,7 +273,6 @@ private fun SettingsContent( firstButtonText = "", lastButtonText = okButtonText, ) - } if (showDialog.value) AlertDialog(