BiggerStreamPreview: Hide element if no stream is found
This commit is contained in:
parent
2039e10fd5
commit
555cf64080
@ -61,14 +61,13 @@ export const handleViewPreview = async ({ guildId, channelId, ownerId }: Applica
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const addViewStreamContext: NavContextMenuPatchCallback = (children, { userId }: { userId: string | bigint; }) => () => {
|
export const addViewStreamContext: NavContextMenuPatchCallback = (children, { userId }: { userId: string | bigint; }) => () => {
|
||||||
const streamPreviewItemIdentifier = "view-stream-preview";
|
|
||||||
|
|
||||||
const stream = ApplicationStreamingStore.getAnyStreamForUser(userId);
|
const stream = ApplicationStreamingStore.getAnyStreamForUser(userId);
|
||||||
|
if (!stream) return;
|
||||||
|
|
||||||
const streamPreviewItem = (
|
const streamPreviewItem = (
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
label="View Stream Preview"
|
label="View Stream Preview"
|
||||||
id={streamPreviewItemIdentifier}
|
id="view-stream-preview"
|
||||||
icon={ScreenshareIcon}
|
icon={ScreenshareIcon}
|
||||||
action={() => stream && handleViewPreview(stream)}
|
action={() => stream && handleViewPreview(stream)}
|
||||||
disabled={!stream}
|
disabled={!stream}
|
||||||
|
Loading…
Reference in New Issue
Block a user