Add the ability to unlike posts

Changelog-Added: Add ability to unlike posts
Closes: #580
This commit is contained in:
Oleg Gordiichuk
2023-02-12 22:45:47 +01:00
committed by William Casarin
parent 4f86361b63
commit 237c939639
5 changed files with 59 additions and 7 deletions

View File

@@ -120,6 +120,15 @@ struct EventActionBar: View {
self.bar.our_like = liked.event
}
}
.onReceive(handle_notify(.delete)) { delete in
guard let deleteRequest = delete.object as? NostrEvent, deleteRequest.tags.flatMap({$0}).contains(event.id),
deleteRequest.pubkey == damus_state.keypair.pubkey else {
return
}
self.bar.our_like = nil
self.bar.likes -= 1
}
}
func send_boost() {