Turn off Start Automaticelly automatically if the permission is denied

This commit is contained in:
Juha Heinanen
2026-04-26 10:22:59 +03:00
parent 2184780eb4
commit 55d2704c33

View File

@ -254,6 +254,13 @@ private fun SettingsContent(
viewModel.autoStart.value = true viewModel.autoStart.value = true
pendingAutoStart = false pendingAutoStart = false
} }
if (viewModel.autoStart.value && !isAppearOnTopPermissionGranted(ctx)) {
viewModel.autoStart.value = false
if (Config.variable("auto_start") == "yes") {
Config.replaceVariable("auto_start", "no")
Config.save()
}
}
} }
} }
lifecycleOwner.lifecycle.addObserver(observer) lifecycleOwner.lifecycle.addObserver(observer)
@ -1204,11 +1211,6 @@ private fun SettingsContent(
} }
} }
if (Config.variable("auto_start") == "yes" &&
!isAppearOnTopPermissionGranted(LocalContext.current)) {
Config.replaceVariable("auto_start", "no")
save = true
}
val scrollState = rememberScrollState() val scrollState = rememberScrollState()