Merge branch 'main' into emotes
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
import { Icon } from "element/icon";
|
||||
import "./layout.css";
|
||||
import { EventPublisher } from "@snort/system";
|
||||
import {
|
||||
EventPublisher,
|
||||
NostrEvent,
|
||||
encodeTLV,
|
||||
NostrPrefix,
|
||||
} from "@snort/system";
|
||||
import { Outlet, useNavigate } from "react-router-dom";
|
||||
import AsyncButton from "element/async-button";
|
||||
import { Login } from "index";
|
||||
@ -58,6 +63,19 @@ export function LayoutPage() {
|
||||
);
|
||||
}
|
||||
|
||||
function goToStream(ev: NostrEvent) {
|
||||
const d = ev.tags.find((t) => t.at(0) === "d")?.at(1) || "";
|
||||
const naddr = encodeTLV(
|
||||
NostrPrefix.Address,
|
||||
d,
|
||||
undefined,
|
||||
ev.kind,
|
||||
ev.pubkey
|
||||
);
|
||||
navigate(`/live/${naddr}`);
|
||||
setNewStream(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
@ -74,7 +92,7 @@ export function LayoutPage() {
|
||||
<Outlet />
|
||||
{newStream && (
|
||||
<Modal onClose={() => setNewStream(false)}>
|
||||
<NewStream onFinish={() => navigate("/")} />
|
||||
<NewStream onFinish={goToStream} />
|
||||
</Modal>
|
||||
)}
|
||||
</>
|
||||
|
Reference in New Issue
Block a user