BiggerStreamPreview: Hide element if no stream is found

main
V 1 year ago
parent 2039e10fd5
commit 555cf64080
No known key found for this signature in database
GPG Key ID: A1DC0CFB5615D905

@ -61,14 +61,13 @@ export const handleViewPreview = async ({ guildId, channelId, ownerId }: Applica
};
export const addViewStreamContext: NavContextMenuPatchCallback = (children, { userId }: { userId: string | bigint; }) => () => {
const streamPreviewItemIdentifier = "view-stream-preview";
const stream = ApplicationStreamingStore.getAnyStreamForUser(userId);
if (!stream) return;
const streamPreviewItem = (
<Menu.MenuItem
label="View Stream Preview"
id={streamPreviewItemIdentifier}
id="view-stream-preview"
icon={ScreenshareIcon}
action={() => stream && handleViewPreview(stream)}
disabled={!stream}

Loading…
Cancel
Save