mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-24 22:25:19 +00:00
fix(geohash): cleanup sampling subscriptions when closing location sheet (#659)
- Added DisposableEffect to LocationChannelsSheet to ensure cleanup runs when composable is removed - Fixed ChatViewModel.endGeohashSampling() to correctly delegate to GeohashViewModel instead of being a no-op - Prevents lingering kind 20001 subscriptions after closing the sheet
This commit is contained in:
@@ -1046,7 +1046,7 @@ class ChatViewModel(
|
||||
* End geohash sampling
|
||||
*/
|
||||
fun endGeohashSampling() {
|
||||
// No-op in refactored architecture; sampling subscriptions are short-lived
|
||||
geohashViewModel.endGeohashSampling()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -542,6 +542,13 @@ fun LocationChannelsSheet(
|
||||
viewModel.endGeohashSampling()
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure cleanup when the composable is destroyed (e.g. removed from parent composition)
|
||||
DisposableEffect(Unit) {
|
||||
onDispose {
|
||||
viewModel.endGeohashSampling()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user