fix: nostr operations cause app crashing #20

Merged
reya merged 4 commits from fix-external-signer into master 2026-06-12 08:49:15 +00:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit 5142e2cbc1 - Show all commits

View File

@@ -110,9 +110,6 @@ fun ChatScreen(id: Long) {
// Start loading spinner
loading = true
// Get msg relays for each member
viewModel.chatRoomConnect(id)
// Get messages
val initialMessages = viewModel.getChatRoomMessages(id)
messages.clear()
@@ -121,6 +118,9 @@ fun ChatScreen(id: Long) {
// Stop loading spinner
loading = false
// Get msg relays for each member
viewModel.chatRoomConnect(id)
// Handle new messages
viewModel.newEvents.collect { event ->
if (event.roomId() == id) {

View File

@@ -386,7 +386,7 @@ class Nostr {
val tags = listOf(
Tag.identifier(giftId.toHex()),
Tag.event(rumor.id()!!),
Tag.custom("a", listOf(roomId.toString())),
Tag.custom("r", listOf(roomId.toString())),
Tag.custom("k", listOf("14"))
)
@@ -396,7 +396,7 @@ class Nostr {
// Construct event
val event = EventBuilder(kind, rumor.asJson())
.tags(tags)
.finalizeAsync(signer)
.finalizeAsync(Keys.generate())
client?.database()?.saveEvent(event)
} catch (e: Exception) {