Preserve order of bookmarks when saving

Changelog-Fixed: Preserve order of bookmarks when saving
This commit is contained in:
William Casarin
2023-04-27 13:04:46 -07:00
parent 1394122542
commit 9d209f485c

View File

@@ -19,7 +19,7 @@ func load_bookmarks(pubkey: String) -> [NostrEvent] {
}
func save_bookmarks(pubkey: String, current_value: [NostrEvent], value: [NostrEvent]) -> Bool {
let uniq_bookmarks = Array(Set(value))
let uniq_bookmarks = uniq(value)
if uniq_bookmarks != current_value {
let encoded = uniq_bookmarks.map(event_to_json)