From e5978981f3f277077eae2134c88c3b9a03fa88eb Mon Sep 17 00:00:00 2001 From: DeclanE <160616898+declan8010@users.noreply.github.com> Date: Sun, 10 Mar 2024 22:32:27 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Disable=20'As=20profile=20picture'=20opt?= =?UTF-8?q?ion=20for=20videos=20in=20context=20menu=20a=E2=80=A6=20(#7830)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: Disable 'As profile picture' option for videos in context menu asset-viewer-nav-bar.svelte This commit modifies the context menu behavior to disable the "As profile picture" option when interacting with video assets. Previously, the option was available for all asset types, including videos, which could lead to confusion when this displayed an error. With this change, the "As profile picture" option is conditionally rendered based on the asset type. If the asset is a video, the option is not displayed in the context menu. This adjustment enhances the web experience by preventing users from attempting to set a video as their profile picture, which is not supported by the system. Fixes: #7724 * Switched to check if photo instead of video --- .../lib/components/asset-viewer/asset-viewer-nav-bar.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte index 227fb13942..4d09e17050 100644 --- a/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte +++ b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte @@ -186,7 +186,9 @@ on:click={() => dispatch('toggleArchive')} text={asset.isArchived ? 'Unarchive' : 'Archive'} /> - onMenuClick('asProfileImage')} text="As profile picture" /> + {#if asset.type === AssetTypeEnum.Image} + onMenuClick('asProfileImage')} text="As profile picture" /> + {/if} {#if hasStackChildren} onMenuClick('unstack')} text="Un-Stack" />