bug: tryParseNostrLink

This commit is contained in:
2023-06-13 14:46:16 +01:00
parent fdf3d855df
commit 7992601f46
6 changed files with 18 additions and 20 deletions

View File

@ -2,7 +2,7 @@ import "./ProfilePage.css";
import { useEffect, useState } from "react";
import { useIntl, FormattedMessage } from "react-intl";
import { useNavigate, useParams } from "react-router-dom";
import { encodeTLV, EventKind, HexKey, NostrPrefix, parseNostrLink } from "@snort/system";
import { encodeTLV, EventKind, HexKey, NostrPrefix, tryParseNostrLink } from "@snort/system";
import { getReactions, unwrap } from "SnortUtils";
import { formatShort } from "Number";
@ -157,7 +157,7 @@ export default function ProfilePage() {
setId(a);
});
} else {
const nav = parseNostrLink(params.id ?? "");
const nav = tryParseNostrLink(params.id ?? "");
if (nav?.type === NostrPrefix.PublicKey || nav?.type === NostrPrefix.Profile) {
// todo: use relays if any for nprofile
setId(nav.id);