Fix bug with reaction notifications referencing the wrong event

Changelog-Fixed: Fix bug with reaction notifications referencing the wrong event
This commit is contained in:
2023-04-29 15:20:04 -04:00
parent 68ed3d7796
commit 242ef4e0cc

View File

@@ -1107,7 +1107,7 @@ func process_local_notification(damus_state: DamusState, event ev: NostrEvent) {
let notify = LocalNotification(type: .repost, event: ev, target: inner_ev, content: inner_ev.content)
create_local_notification(profiles: damus_state.profiles, notify: notify)
} else if type == .like && damus_state.settings.like_notification,
let evid = ev.referenced_ids.first?.ref_id,
let evid = ev.referenced_ids.last?.ref_id,
let liked_event = damus_state.events.lookup(evid)
{
let notify = LocalNotification(type: .like, event: ev, target: liked_event, content: liked_event.content)