diff options
author | V <vendicated@riseup.net> | 2023-06-16 19:46:39 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-06-16 19:46:39 +0200 |
commit | 555cf64080b027128f31a8637c5e02bfa1a3e521 (patch) | |
tree | e7cafc6177855865d813806552601742ae841373 | |
parent | 2039e10fd5f410f7f3c3ef9057ac8dcf41706e15 (diff) | |
download | Vencord-555cf64080b027128f31a8637c5e02bfa1a3e521.tar.gz Vencord-555cf64080b027128f31a8637c5e02bfa1a3e521.tar.bz2 Vencord-555cf64080b027128f31a8637c5e02bfa1a3e521.zip |
BiggerStreamPreview: Hide element if no stream is found
-rw-r--r-- | src/plugins/biggerStreamPreview/index.tsx | 5 |
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} |