fix(web): reset select all button state on escape press (#13600)

* factor out cancel multiselect state logic to utils

* use cancel multiselct helper in album page

* use cancel multiselct helper in album-viewer component

* use cancel multiselct helper in asset-grid component

* remove unused to fix lint
This commit is contained in:
Darrel 2024-10-21 02:11:00 +08:00 committed by GitHub
parent ee0130a58b
commit 45517ab7ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 17 deletions

View file

@ -6,7 +6,7 @@
import type { AlbumResponseDto, SharedLinkResponseDto, UserResponseDto } from '@immich/sdk';
import { createAssetInteractionStore } from '$lib/stores/asset-interaction.store';
import { AssetStore } from '$lib/stores/assets.store';
import { downloadAlbum } from '$lib/utils/asset-utils';
import { cancelMultiselect, downloadAlbum } from '$lib/utils/asset-utils';
import CircleIconButton from '../elements/buttons/circle-icon-button.svelte';
import DownloadAction from '../photos-page/actions/download-action.svelte';
import AssetGrid from '../photos-page/asset-grid.svelte';
@ -49,7 +49,7 @@
shortcut: { key: 'Escape' },
onShortcut: () => {
if (!$showAssetViewer && $isMultiSelectState) {
assetInteractionStore.clearMultiselect();
cancelMultiselect(assetInteractionStore);
}
},
}}