Small fixes

This commit is contained in:
Jon Staab 2024-03-18 14:41:11 -07:00
parent c3332be96a
commit 5e1df84f3a
3 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@
$: content = parseContent({content: truncate ? ellipsize(about, 140) : about})
</script>
<p>
<p class="overflow-hidden text-ellipsis">
{#each content as { type, value }}
{#if type === "newline"}
{#each value as _}

View File

@ -37,8 +37,6 @@ export const saveRelayPolicy = (e, relays: RelayPolicy[]) => {
}
export const publishRelays = ($relays: RelayPolicy[]) => {
updateStore(people.key(stateKey.get()), now(), {relays: $relays})
if (canSign.get()) {
return createAndPublish(10002, {
tags: $relays
@ -54,6 +52,8 @@ export const publishRelays = ($relays: RelayPolicy[]) => {
})
.concat(getClientTags()),
})
} else {
updateStore(people.key(stateKey.get()), now(), {relays: $relays})
}
}

View File

@ -1,7 +1,7 @@
import {join} from "ramda"
import {nip44} from "nostr-tools"
import {cached} from "paravel"
import {switcherFn} from "hurdak"
import {switcherFn, tryFunc} from "hurdak"
import type {Session} from "src/engine/session/model"
import type {Connect} from "./connect"
import {withExtension} from "./nip07"
@ -36,7 +36,7 @@ export class Nip44 {
}
decrypt(payload: string, pk: string, sk: string) {
return nip44.v2.decrypt(payload, getSharedSecret(sk, pk))
return tryFunc(() => nip44.v2.decrypt(payload, getSharedSecret(sk, pk)))
}
encryptAsUser(message: string, pk: string) {