This commit is contained in:
2026-05-24 08:30:04 +07:00
parent 9190e6faa3
commit 93f285f02f
2 changed files with 10 additions and 2 deletions

View File

@@ -110,8 +110,10 @@ fun HomeScreen(
?: remember { mutableStateOf(null) } ?: remember { mutableStateOf(null) }
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
if (qrResult == null) {
viewModel.getChatRooms() viewModel.getChatRooms()
} }
}
LaunchedEffect(qrResult) { LaunchedEffect(qrResult) {
qrResult?.let { result -> qrResult?.let { result ->

View File

@@ -436,7 +436,13 @@ class NostrViewModel(
fun getChatRooms() { fun getChatRooms() {
viewModelScope.launch { viewModelScope.launch {
_chatRooms.value = nostr.getChatRooms() ?: emptySet() val rooms = nostr.getChatRooms() ?: emptySet()
_chatRooms.update { currentRooms ->
val virtualRooms = currentRooms.filter { local ->
rooms.none { db -> db.id == local.id }
}
rooms + virtualRooms
}
} }
} }