fix a few bugs

This commit is contained in:
Jon Staab 2024-03-18 09:22:53 -07:00
parent fa239991ac
commit c3332be96a
3 changed files with 13 additions and 7 deletions

View File

@ -18,7 +18,7 @@
const pubkeys = channel.id.split(",") as string[]
const displayPubkeys = pubkeys.length === 1 ? pubkeys : without([$pubkey], pubkeys)
const showAlert = channels.key(channel.id).derived(channelHasNewMessages)
const members = people.mapStore.derived($p => displayPubkeys.map(pk => $p.get(pk)))
const members = people.mapStore.derived($p => displayPubkeys.map(pk => $p.get(pk) || {pubkey: pk}))
const enter = () => router.at("channels").of(pubkeys).push()

View File

@ -22,7 +22,7 @@ export const getStalePubkeys = (pubkeys: Iterable<string>) => {
const since = now() - seconds(3, "hour")
for (const pubkey of pubkeys) {
if (!pubkey.match(/^[0-f]{64}$/)) {
if (!pubkey?.match(/^[0-f]{64}$/)) {
continue
}

View File

@ -11,11 +11,17 @@
const dispatch = createEventDispatcher()
const getClick = e => ({
x: e.x || e.touches[0].clientX,
y: e.y || e.touches[0].clientY,
t: Date.now(),
})
const getClick = e => {
if (!e.touches) {
return null
}
return {
x: e.x || e.touches[0].clientX,
y: e.y || e.touches[0].clientY,
t: Date.now(),
}
}
const startClick = e => {
click = getClick(e)