From a2e38270e4658aaa97dced9a58ddd8970ac175a1 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Sat, 6 Apr 2024 07:28:39 -0600 Subject: [PATCH] fix(web): bypass the onStackAssets shortcut when only one is selected (#8559) Selecting one asset and pressing 's' would show 'Stacked 1 assets' and result in a noop. This change prevents the notification and exiting the select mode. --- web/src/lib/components/photos-page/asset-grid.svelte | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web/src/lib/components/photos-page/asset-grid.svelte b/web/src/lib/components/photos-page/asset-grid.svelte index 9aca51fa00..c8ca6b17a6 100644 --- a/web/src/lib/components/photos-page/asset-grid.svelte +++ b/web/src/lib/components/photos-page/asset-grid.svelte @@ -87,10 +87,12 @@ }; const onStackAssets = async () => { - await stackAssets(Array.from($selectedAssets), (ids) => { - assetStore.removeAssets(ids); - dispatch('escape'); - }); + if ($selectedAssets.size > 1) { + await stackAssets(Array.from($selectedAssets), (ids) => { + assetStore.removeAssets(ids); + dispatch('escape'); + }); + } }; $: shortcutList = (() => {