Files
immich/web/src/lib/components/photos-page/actions/select-all-assets.svelte
Snowknight26 6a5bc156a6 fix(web): allow deselecting all assets from select bar (#9320)
* fix(web): allow deselecting all assets from select bar

* Change deselect logo

* select remove

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-05-08 03:05:19 +00:00

26 lines
955 B
Svelte

<script lang="ts">
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import type { AssetInteractionStore } from '$lib/stores/asset-interaction.store';
import { type AssetStore, isSelectingAllAssets } from '$lib/stores/assets.store';
import { mdiSelectAll, mdiSelectRemove } from '@mdi/js';
import { selectAllAssets } from '$lib/utils/asset-utils';
export let assetStore: AssetStore;
export let assetInteractionStore: AssetInteractionStore;
const handleSelectAll = async () => {
await selectAllAssets(assetStore, assetInteractionStore);
};
const handleCancel = () => {
$isSelectingAllAssets = false;
assetInteractionStore.clearMultiselect();
};
</script>
{#if $isSelectingAllAssets}
<CircleIconButton title="Unselect all" icon={mdiSelectRemove} on:click={handleCancel} />
{:else}
<CircleIconButton title="Select all" icon={mdiSelectAll} on:click={handleSelectAll} />
{/if}