mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 03:45:21 +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
|
* End geohash sampling
|
||||||
*/
|
*/
|
||||||
fun endGeohashSampling() {
|
fun endGeohashSampling() {
|
||||||
// No-op in refactored architecture; sampling subscriptions are short-lived
|
geohashViewModel.endGeohashSampling()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -542,6 +542,13 @@ fun LocationChannelsSheet(
|
|||||||
viewModel.endGeohashSampling()
|
viewModel.endGeohashSampling()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure cleanup when the composable is destroyed (e.g. removed from parent composition)
|
||||||
|
DisposableEffect(Unit) {
|
||||||
|
onDispose {
|
||||||
|
viewModel.endGeohashSampling()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
Reference in New Issue
Block a user