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

View File

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