bug: tryParseNostrLink
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import { NostrPrefix, parseNostrLink } from "@snort/system";
|
||||
import { NostrPrefix, tryParseNostrLink } from "@snort/system";
|
||||
|
||||
import Mention from "Element/Mention";
|
||||
import NoteQuote from "Element/NoteQuote";
|
||||
|
||||
export default function NostrLink({ link, depth }: { link: string; depth?: number }) {
|
||||
const nav = parseNostrLink(link);
|
||||
const nav = tryParseNostrLink(link);
|
||||
|
||||
if (nav?.type === NostrPrefix.PublicKey || nav?.type === NostrPrefix.Profile) {
|
||||
return <Mention pubkey={nav.id} relays={nav.relays} />;
|
||||
|
@ -218,9 +218,9 @@ export default function Thread() {
|
||||
const location = useLocation();
|
||||
|
||||
const link = parseNostrLink(params.id ?? "", NostrPrefix.Note);
|
||||
const thread = useThreadFeed(unwrap(link));
|
||||
const thread = useThreadFeed(link);
|
||||
|
||||
const [currentId, setCurrentId] = useState(link?.id);
|
||||
const [currentId, setCurrentId] = useState(link.id);
|
||||
|
||||
const navigate = useNavigate();
|
||||
const isSingleNote = thread.data?.filter(a => a.kind === EventKind.TextNote).length === 1;
|
||||
|
Reference in New Issue
Block a user