This commit is contained in:
callebtc
2025-10-17 23:51:16 +02:00
parent 835283ec64
commit abb415c488
2 changed files with 8 additions and 3 deletions
@@ -442,6 +442,9 @@ private fun ChatFloatingHeader(
onLocationChannelsClick: () -> Unit,
onLocationNotesClick: () -> Unit
) {
val context = androidx.compose.ui.platform.LocalContext.current
val locationManager = remember { com.bitchat.android.geohash.LocationChannelManager.getInstance(context) }
Surface(
modifier = Modifier
.fillMaxWidth()
@@ -466,7 +469,11 @@ private fun ChatFloatingHeader(
onTripleClick = onPanicClear,
onShowAppInfo = onShowAppInfo,
onLocationChannelsClick = onLocationChannelsClick,
onLocationNotesClick = onLocationNotesClick
onLocationNotesClick = {
// Ensure location is loaded before showing sheet
locationManager.refreshChannels()
onLocationNotesClick()
}
)
},
colors = TopAppBarDefaults.topAppBarColors(
@@ -573,8 +573,6 @@ fun LocationChannelsSheet(
if (isPresented) {
if (permissionState == LocationChannelManager.PermissionState.AUTHORIZED && locationServicesEnabled) {
locationManager.refreshChannels()
}
if (locationServicesEnabled) {
locationManager.beginLiveRefresh()
}
val geohashes = (availableChannels.map { it.geohash } + bookmarks).toSet().toList()