fix: chat link
This commit is contained in:
parent
cd43bb3cf9
commit
0a2ba19032
@ -1,5 +1,5 @@
|
|||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { NostrPrefix, encodeTLV, parseNostrLink } from "@snort/system";
|
import { NostrLink, parseNostrLink } from "@snort/system";
|
||||||
import { unwrap } from "@snort/shared";
|
import { unwrap } from "@snort/shared";
|
||||||
|
|
||||||
import { LiveChat } from "@/element/chat/live-chat";
|
import { LiveChat } from "@/element/chat/live-chat";
|
||||||
@ -13,19 +13,18 @@ export function ChatPopout() {
|
|||||||
const ev = useCurrentStreamFeed(link, true);
|
const ev = useCurrentStreamFeed(link, true);
|
||||||
const goal = useZapGoal(findTag(ev, "goal"));
|
const goal = useZapGoal(findTag(ev, "goal"));
|
||||||
|
|
||||||
const lnk = parseNostrLink(encodeTLV(NostrPrefix.Address, findTag(ev, "d") ?? "", undefined, ev?.kind, ev?.pubkey));
|
|
||||||
const chat = Boolean(new URL(window.location.href).searchParams.get("chat"));
|
const chat = Boolean(new URL(window.location.href).searchParams.get("chat"));
|
||||||
return (
|
return (
|
||||||
<div className="h-[calc(100vh-1rem)] w-screen px-2 my-2">
|
<div className="h-[calc(100vh-1rem)] w-screen px-2 my-2">
|
||||||
<LiveChat
|
{ev && <LiveChat
|
||||||
ev={ev}
|
ev={ev}
|
||||||
link={lnk}
|
link={NostrLink.fromEvent(ev)}
|
||||||
canWrite={chat}
|
canWrite={chat}
|
||||||
showScrollbar={false}
|
showScrollbar={false}
|
||||||
goal={goal}
|
goal={goal}
|
||||||
className="h-inherit"
|
className="h-inherit"
|
||||||
autoRaid={false}
|
autoRaid={false}
|
||||||
/>
|
/>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user