fix(android): block onboarding advance until special setup is complete

This commit is contained in:
Ayaan Zaidi
2026-02-28 12:10:18 +05:30
committed by Ayaan Zaidi
parent cd61edb0f3
commit 3f056a7294

View File

@@ -319,14 +319,18 @@ fun OnboardingFlow(viewModel: MainViewModel, modifier: Modifier = Modifier) {
if (enabled.isEmpty()) "None selected" else enabled.joinToString(", ")
}
val proceedFromPermissions: () -> Unit = {
when {
enableNotificationListener && !isNotificationListenerEnabled(context) -> {
openNotificationListenerSettings(context)
}
enableAppUpdates && !canInstallUnknownApps(context) -> {
openUnknownAppSourcesSettings(context)
}
val proceedFromPermissions: () -> Unit = proceed@{
var openedSpecialSetup = false
if (enableNotificationListener && !isNotificationListenerEnabled(context)) {
openNotificationListenerSettings(context)
openedSpecialSetup = true
}
if (enableAppUpdates && !canInstallUnknownApps(context)) {
openUnknownAppSourcesSettings(context)
openedSpecialSetup = true
}
if (openedSpecialSetup) {
return@proceed
}
step = OnboardingStep.FinalCheck
}