fix: short link only live streams
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user