fix: location disclosure missing

This commit is contained in:
Zane Schepke 2024-08-13 16:55:14 -04:00
parent ffeb089aa7
commit 7e3405f3fd
2 changed files with 58 additions and 59 deletions

View File

@ -269,9 +269,8 @@ fun SettingsScreen(
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
checkFineLocationGranted()
}
if(!uiState.isLocationDisclosureShown) {
BackgroundLocationDisclosure(
!uiState.isLocationDisclosureShown,
onDismiss = { viewModel.setLocationDisclosureShown() },
onAttest = {
context.launchAppSettings()
@ -280,6 +279,9 @@ fun SettingsScreen(
scrollState,
focusRequester,
)
return
}
BackgroundLocationDialog(
showLocationDialog,

View File

@ -29,14 +29,12 @@ import com.zaneschepke.wireguardautotunnel.util.extensions.isRunningOnTv
@Composable
fun BackgroundLocationDisclosure(
show: Boolean,
onDismiss: () -> Unit,
onAttest: () -> Unit,
scrollState: ScrollState,
focusRequester: FocusRequester,
) {
val context = LocalContext.current
if (show) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Top,
@ -92,5 +90,4 @@ fun BackgroundLocationDisclosure(
}
}
}
}
}