mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-19 11:43:35 +00:00
Fix huge qr codes for profile sharing
This commit is contained in:
parent
31b9f1ffde
commit
c7b18d2531
@ -1,5 +1,6 @@
|
||||
# Current
|
||||
|
||||
- [ ] Mentions don't show up in notifications
|
||||
- [ ] Fix relay recommendations
|
||||
- [ ] Preview note1
|
||||
- [ ] Pagination is slow. Maybe load with no window first, then add since?
|
||||
|
@ -251,20 +251,24 @@ addHandler(
|
||||
30078,
|
||||
profileHandler("last_checked", async (e, p) => {
|
||||
if (Tags.from(e).getMeta("d") === "coracle/last_checked/v1") {
|
||||
const payload = await keys.decryptJson(e.content)
|
||||
const updates = {}
|
||||
for (const k of Object.keys(payload).concat(p.last_checked)) {
|
||||
const v = Math.max(payload[k] || 0, p.last_checked[k] || 0)
|
||||
try {
|
||||
const payload = await keys.decryptJson(e.content)
|
||||
const updates = {}
|
||||
for (const k of Object.keys(payload).concat(p.last_checked)) {
|
||||
const v = Math.max(payload[k] || 0, p.last_checked[k] || 0)
|
||||
|
||||
// A bunch of junk got added to this setting. Integer keys, settings, etc
|
||||
if (isNaN(v) || v < 1577836800) {
|
||||
continue
|
||||
// A bunch of junk got added to this setting. Integer keys, settings, etc
|
||||
if (isNaN(v) || v < 1577836800) {
|
||||
continue
|
||||
}
|
||||
|
||||
updates[k] = v
|
||||
}
|
||||
|
||||
updates[k] = v
|
||||
return updates
|
||||
} catch (e) {
|
||||
// pass
|
||||
}
|
||||
|
||||
return updates
|
||||
}
|
||||
})
|
||||
)
|
||||
|
@ -8,11 +8,11 @@
|
||||
export let person
|
||||
|
||||
const {pubkey} = person
|
||||
const relays = pluck("url", getPubkeyWriteRelays(pubkey))
|
||||
const relays = pluck("url", getPubkeyWriteRelays(pubkey).slice(0, 5))
|
||||
const nprofile = nip19.nprofileEncode({pubkey, relays})
|
||||
</script>
|
||||
|
||||
<Content size="lg">
|
||||
<QRCode code={nprofile} />
|
||||
<QRCode code={`https://coracle.social/${nprofile}`} />
|
||||
<div class="text-center text-gray-1">Copy or scan from a nostr app to share this profile.</div>
|
||||
</Content>
|
||||
|
Loading…
Reference in New Issue
Block a user