fix: short link only live streams

This commit is contained in:
2025-05-28 21:18:25 +01:00
parent 21c6be9195
commit e400debde2

View File

@ -65,15 +65,19 @@ export function StreamTile({
const [videoLink, setVideoLink] = useState(`/${link.encode()}`) const [videoLink, setVideoLink] = useState(`/${link.encode()}`)
useEffect(() => { useEffect(() => {
fetchNostrAddresByPubkey(host, NIP5_DOMAIN).then((h) => { if (status === StreamState.Live) {
if (h) { fetchNostrAddresByPubkey(host, NIP5_DOMAIN).then((h) => {
const names = Object.entries(h.names); if (h) {
if (names.length > 0) { const names = Object.entries(h.names);
setVideoLink(`/${names[0][0]}`); if (names.length > 0) {
setVideoLink(`/${names[0][0]}`);
}
} }
}
}); });
}, [videoLink]); }
}, [status, videoLink]);
const [hasImg, setHasImage] = useState((image?.length ?? 0) > 0 || (recording?.length ?? 0) > 0); const [hasImg, setHasImage] = useState((image?.length ?? 0) > 0 || (recording?.length ?? 0) > 0);
return ( return (
<div <div