diff --git a/app/src/main/java/com/bitchat/android/ui/LocationChannelsSheet.kt b/app/src/main/java/com/bitchat/android/ui/LocationChannelsSheet.kt index 19156485..505ea5b0 100644 --- a/app/src/main/java/com/bitchat/android/ui/LocationChannelsSheet.kt +++ b/app/src/main/java/com/bitchat/android/ui/LocationChannelsSheet.kt @@ -399,6 +399,18 @@ fun LocationChannelsSheet( AboutSectionLabel( text = stringResource(R.string.location_channels_nearby) ) + if (!appLocationEnabled) { + SheetDestructiveButton( + text = stringResource(R.string.enable_location_services), + isDestructive = false, + onClick = { locationManager.enableLocationServices() }, + modifier = Modifier.padding( + start = AboutHorizontalPadding, + end = AboutHorizontalPadding, + bottom = 10.dp + ) + ) + } Surface( modifier = Modifier .fillMaxWidth() @@ -561,27 +573,19 @@ fun LocationChannelsSheet( } } - item(key = "location_toggle") { - SheetDestructiveButton( - text = if (appLocationEnabled) { - stringResource(R.string.disable_location_services) - } else { - stringResource(R.string.enable_location_services) - }, - isDestructive = appLocationEnabled, - onClick = { - if (appLocationEnabled) { - locationManager.disableLocationServices() - } else { - locationManager.enableLocationServices() - } - }, - modifier = Modifier.padding( - start = AboutHorizontalPadding, - end = AboutHorizontalPadding, - top = 24.dp + if (appLocationEnabled) { + item(key = "location_toggle") { + SheetDestructiveButton( + text = stringResource(R.string.disable_location_services), + isDestructive = true, + onClick = { locationManager.disableLocationServices() }, + modifier = Modifier.padding( + start = AboutHorizontalPadding, + end = AboutHorizontalPadding, + top = 24.dp + ) ) - ) + } } }