Fix notifications getting re-set

This commit is contained in:
Jonathan Staab 2023-05-03 08:59:20 -07:00
parent 23ef0a9d26
commit d4f26abad4
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import {is, uniq, prop, reject, nth, uniqBy, objOf, pick, identity} from "ramda"
import {filter, is, uniq, prop, reject, nth, uniqBy, objOf, pick, identity} from "ramda"
import {nip05} from "nostr-tools"
import {noop, ensurePlural, chunk} from "hurdak/lib/hurdak"
import {
@ -251,7 +251,12 @@ addHandler(
30078,
profileHandler("last_checked", async (e, p) => {
if (Tags.from(e).getMeta("d") === "coracle/last_checked/v1") {
return {...p.last_checked, ...(await keys.decryptJson(e.content))}
const updates = filter(
([k, v]) => p.last_checked[k] || 0 < v,
Object.entries(await keys.decryptJson(e.content))
)
return {...p.last_checked, ...updates}
}
})
)

View File

@ -103,7 +103,7 @@
})}>
<div
class={cx("inline-block max-w-xl rounded-2xl py-2 px-4", {
"rounded-br-none bg-gray-2 text-end text-gray-8":
"rounded-br-none bg-gray-1 text-end text-gray-8":
message.person.pubkey === user.getPubkey(),
"rounded-bl-none bg-gray-7": message.person.pubkey !== user.getPubkey(),
})}>