mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 23:06:24 +02:00
Fixes the loading of GiftWraps as intents in the app.
This commit is contained in:
@@ -25,6 +25,8 @@ import com.vitorpamplona.amethyst.model.Note
|
|||||||
import com.vitorpamplona.amethyst.ui.navigation.Route
|
import com.vitorpamplona.amethyst.ui.navigation.Route
|
||||||
import com.vitorpamplona.quartz.events.ChannelCreateEvent
|
import com.vitorpamplona.quartz.events.ChannelCreateEvent
|
||||||
import com.vitorpamplona.quartz.events.ChatroomKeyable
|
import com.vitorpamplona.quartz.events.ChatroomKeyable
|
||||||
|
import com.vitorpamplona.quartz.events.GiftWrapEvent
|
||||||
|
import com.vitorpamplona.quartz.events.SealedGossipEvent
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@@ -75,9 +77,17 @@ fun LoadRedirectScreen(baseNote: Note, accountViewModel: AccountViewModel, nav:
|
|||||||
|
|
||||||
LaunchedEffect(key1 = noteState) {
|
LaunchedEffect(key1 = noteState) {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
val note = noteState?.note
|
val note = noteState?.note ?: return@launch
|
||||||
val event = note?.event
|
var event = note.event
|
||||||
val channelHex = note?.channelHex()
|
val channelHex = note.channelHex()
|
||||||
|
|
||||||
|
if (event is GiftWrapEvent) {
|
||||||
|
event = accountViewModel.unwrap(event)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event is SealedGossipEvent) {
|
||||||
|
event = accountViewModel.unseal(event)
|
||||||
|
}
|
||||||
|
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
// stay here, loading
|
// stay here, loading
|
||||||
|
Reference in New Issue
Block a user