Browse Source

bug-fixes

imwald
Silberengel 4 weeks ago
parent
commit
15d8237b29
  1. 5
      src/components/ProfileOptions/index.tsx
  2. 3
      src/lib/cache-event-import.test.ts

5
src/components/ProfileOptions/index.tsx

@ -9,7 +9,7 @@ import {
import { usePrimaryPage } from '@/contexts/primary-page-context' import { usePrimaryPage } from '@/contexts/primary-page-context'
import { buildHiveTalkJoinUrl, roomIdForPubkeys } from '@/lib/hivetalk' import { buildHiveTalkJoinUrl, roomIdForPubkeys } from '@/lib/hivetalk'
import { getNostrArchivesProfileUrl, openExternalUrl } from '@/lib/link' import { getNostrArchivesProfileUrl, openExternalUrl } from '@/lib/link'
import { formatPubkey, pubkeyToNpub } from '@/lib/pubkey' import { pubkeyToNpub } from '@/lib/pubkey'
import { useMuteList } from '@/contexts/mute-list-context' import { useMuteList } from '@/contexts/mute-list-context'
import { muteSetHas } from '@/lib/mute-set' import { muteSetHas } from '@/lib/mute-set'
import { normalizeAnyRelayUrl } from '@/lib/url' import { normalizeAnyRelayUrl } from '@/lib/url'
@ -59,7 +59,7 @@ export default function ProfileOptions({
}) { }) {
const { t } = useTranslation() const { t } = useTranslation()
const { navigate } = usePrimaryPage() const { navigate } = usePrimaryPage()
const { pubkey: accountPubkey, profile, publish, checkLogin } = useNostr() const { pubkey: accountPubkey, publish, checkLogin } = useNostr()
const { mutePubkeySet, mutePubkeyPrivately, mutePubkeyPublicly, unmutePubkey } = useMuteList() const { mutePubkeySet, mutePubkeyPrivately, mutePubkeyPublicly, unmutePubkey } = useMuteList()
const { relayUrls: currentBrowsingRelayUrls } = useCurrentRelays() const { relayUrls: currentBrowsingRelayUrls } = useCurrentRelays()
const { relaySets, favoriteRelays } = useFavoriteRelays() const { relaySets, favoriteRelays } = useFavoriteRelays()
@ -93,7 +93,6 @@ export default function ProfileOptions({
}, [pubkey, profileEvent]) }, [pubkey, profileEvent])
const isMuted = useMemo(() => muteSetHas(mutePubkeySet, pubkey), [mutePubkeySet, pubkey]) const isMuted = useMemo(() => muteSetHas(mutePubkeySet, pubkey), [mutePubkeySet, pubkey])
const displayName = profile?.username ?? (accountPubkey ? formatPubkey(accountPubkey) : 'jumble')
const nostrArchivesProfileUrl = useMemo(() => getNostrArchivesProfileUrl(pubkey), [pubkey]) const nostrArchivesProfileUrl = useMemo(() => getNostrArchivesProfileUrl(pubkey), [pubkey])
/** All available relays: current feed, favorites, relay sets, defaults (FAST_READ, FAST_WRITE). */ /** All available relays: current feed, favorites, relay sets, defaults (FAST_READ, FAST_WRITE). */

3
src/lib/cache-event-import.test.ts

@ -1,10 +1,9 @@
import { describe, expect, it } from 'vitest' import { describe, expect, it } from 'vitest'
import { kinds, finalizeEvent, generateSecretKey, getPublicKey } from 'nostr-tools' import { kinds, finalizeEvent, generateSecretKey } from 'nostr-tools'
import { parseJsonlCacheImportText, parsePastedCacheImportJson } from './cache-event-import' import { parseJsonlCacheImportText, parsePastedCacheImportJson } from './cache-event-import'
function signedNote(content: string) { function signedNote(content: string) {
const sk = generateSecretKey() const sk = generateSecretKey()
const pubkey = getPublicKey(sk)
return finalizeEvent( return finalizeEvent(
{ {
kind: kinds.ShortTextNote, kind: kinds.ShortTextNote,

Loading…
Cancel
Save