update chat screen

This commit is contained in:
2026-05-11 14:28:52 +07:00
parent 6f7c7ccd63
commit 5e2dfd447f
6 changed files with 294 additions and 49 deletions
@@ -80,7 +80,7 @@ class NostrViewModel(
}
val now = Clock.System.now().toEpochMilliseconds()
if (batch.size >= 20 || (now - lastFlushTime) >= timeout || nextKey == null) {
if (batch.size >= 10 || (now - lastFlushTime) >= timeout || nextKey == null) {
val keysToRequest = batch.toList()
batch.clear()
nostr.fetchMetadataBatch(keysToRequest)
@@ -271,6 +271,11 @@ class NostrViewModel(
}
}
fun getChatRoom(id: Long): Room {
return chatRooms.value.firstOrNull { it.id == id }
?: throw IllegalArgumentException("Room not found")
}
fun getChatRooms() {
viewModelScope.launch {
try {