mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 06:45: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:
@@ -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