aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/biggerStreamPreview
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-06-16 19:46:39 +0200
committerV <vendicated@riseup.net>2023-06-16 19:46:39 +0200
commit555cf64080b027128f31a8637c5e02bfa1a3e521 (patch)
treee7cafc6177855865d813806552601742ae841373 /src/plugins/biggerStreamPreview
parent2039e10fd5f410f7f3c3ef9057ac8dcf41706e15 (diff)
downloadVencord-555cf64080b027128f31a8637c5e02bfa1a3e521.tar.gz
Vencord-555cf64080b027128f31a8637c5e02bfa1a3e521.tar.bz2
Vencord-555cf64080b027128f31a8637c5e02bfa1a3e521.zip
BiggerStreamPreview: Hide element if no stream is found
Diffstat (limited to 'src/plugins/biggerStreamPreview')
-rw-r--r--src/plugins/biggerStreamPreview/index.tsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/biggerStreamPreview/index.tsx b/src/plugins/biggerStreamPreview/index.tsx
index d3ed713..acad564 100644
--- a/src/plugins/biggerStreamPreview/index.tsx
+++ b/src/plugins/biggerStreamPreview/index.tsx
@@ -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}