mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-07-22 18:15:20 +02:00
handle stream naddr
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { Alert, AlertIcon, AlertTitle } from "@chakra-ui/react";
|
import { Alert, AlertIcon, AlertTitle } from "@chakra-ui/react";
|
||||||
import { Navigate, useParams } from "react-router-dom";
|
import { Navigate, useParams } from "react-router-dom";
|
||||||
import { nip19 } from "nostr-tools";
|
import { nip19 } from "nostr-tools";
|
||||||
|
import { STREAM_KIND } from "../../helpers/nostr/stream";
|
||||||
|
|
||||||
export default function NostrLinkView() {
|
export default function NostrLinkView() {
|
||||||
const { link } = useParams() as { link?: string };
|
const { link } = useParams() as { link?: string };
|
||||||
@@ -23,6 +24,8 @@ export default function NostrLinkView() {
|
|||||||
case "note":
|
case "note":
|
||||||
case "nevent":
|
case "nevent":
|
||||||
return <Navigate to={`/n/${cleanLink}`} replace />;
|
return <Navigate to={`/n/${cleanLink}`} replace />;
|
||||||
|
case "naddr":
|
||||||
|
if (decoded.data.kind === STREAM_KIND) return <Navigate to={`/streams/${cleanLink}`} replace />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user