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, onLocationChannelsClick: () -> Unit,
onLocationNotesClick: () -> Unit onLocationNotesClick: () -> Unit
) { ) {
val context = androidx.compose.ui.platform.LocalContext.current
val locationManager = remember { com.bitchat.android.geohash.LocationChannelManager.getInstance(context) }
Surface( Surface(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
@@ -466,7 +469,11 @@ private fun ChatFloatingHeader(
onTripleClick = onPanicClear, onTripleClick = onPanicClear,
onShowAppInfo = onShowAppInfo, onShowAppInfo = onShowAppInfo,
onLocationChannelsClick = onLocationChannelsClick, onLocationChannelsClick = onLocationChannelsClick,
onLocationNotesClick = onLocationNotesClick onLocationNotesClick = {
// Ensure location is loaded before showing sheet
locationManager.refreshChannels()
onLocationNotesClick()
}
) )
}, },
colors = TopAppBarDefaults.topAppBarColors( colors = TopAppBarDefaults.topAppBarColors(
@@ -573,8 +573,6 @@ fun LocationChannelsSheet(
if (isPresented) { if (isPresented) {
if (permissionState == LocationChannelManager.PermissionState.AUTHORIZED && locationServicesEnabled) { if (permissionState == LocationChannelManager.PermissionState.AUTHORIZED && locationServicesEnabled) {
locationManager.refreshChannels() locationManager.refreshChannels()
}
if (locationServicesEnabled) {
locationManager.beginLiveRefresh() locationManager.beginLiveRefresh()
} }
val geohashes = (availableChannels.map { it.geohash } + bookmarks).toSet().toList() val geohashes = (availableChannels.map { it.geohash } + bookmarks).toSet().toList()