Fixes event loading for nembeds
This commit is contained in:
@@ -1003,6 +1003,13 @@ class AccountViewModel(val account: Account, val settings: SettingsState) : View
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun loadNEmbedIfNeeded(nembed: Event) {
|
||||||
|
val baseNote = LocalCache.getNoteIfExists(nembed.id)
|
||||||
|
if (baseNote?.event == null) {
|
||||||
|
LocalCache.verifyAndConsume(nembed, null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun parseNIP19(
|
suspend fun parseNIP19(
|
||||||
str: String,
|
str: String,
|
||||||
onNote: (LoadedBechLink) -> Unit,
|
onNote: (LoadedBechLink) -> Unit,
|
||||||
@@ -1018,9 +1025,7 @@ class AccountViewModel(val account: Account, val settings: SettingsState) : View
|
|||||||
is Nip19Bech32.Note -> LocalCache.checkGetOrCreateNote(parsed.hex)?.let { note -> returningNote = note }
|
is Nip19Bech32.Note -> LocalCache.checkGetOrCreateNote(parsed.hex)?.let { note -> returningNote = note }
|
||||||
is Nip19Bech32.NEvent -> LocalCache.checkGetOrCreateNote(parsed.hex)?.let { note -> returningNote = note }
|
is Nip19Bech32.NEvent -> LocalCache.checkGetOrCreateNote(parsed.hex)?.let { note -> returningNote = note }
|
||||||
is Nip19Bech32.NEmbed -> {
|
is Nip19Bech32.NEmbed -> {
|
||||||
if (LocalCache.getNoteIfExists(parsed.event.id) == null) {
|
loadNEmbedIfNeeded(parsed.event)
|
||||||
LocalCache.verifyAndConsume(parsed.event, null)
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalCache.checkGetOrCreateNote(parsed.event.id)?.let { note ->
|
LocalCache.checkGetOrCreateNote(parsed.event.id)?.let { note ->
|
||||||
returningNote = note
|
returningNote = note
|
||||||
|
|||||||
Reference in New Issue
Block a user