1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-26 10:50:29 +02:00

fix(web): Share link multi-select download icon showing when not available #3006 (#3027)

* only show download button if allowDownload
add SelectAll to individual share

* fix allow download if not share
This commit is contained in:
faupau 2023-06-29 17:11:37 +02:00 committed by GitHub
parent 3948247055
commit c065705608
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -351,7 +351,9 @@
clearSelect={() => (multiSelectAsset = new Set())} clearSelect={() => (multiSelectAsset = new Set())}
> >
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll} /> <CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll} />
<DownloadAction filename={album.albumName} sharedLinkKey={sharedLink?.key} /> {#if sharedLink?.allowDownload || !isPublicShared}
<DownloadAction filename={album.albumName} sharedLinkKey={sharedLink?.key} />
{/if}
{#if isOwned} {#if isOwned}
<RemoveFromAlbum bind:album /> <RemoveFromAlbum bind:album />
{/if} {/if}

View File

@ -12,6 +12,7 @@
import AssetSelectControlBar from '../photos-page/asset-select-control-bar.svelte'; import AssetSelectControlBar from '../photos-page/asset-select-control-bar.svelte';
import ControlAppBar from '../shared-components/control-app-bar.svelte'; import ControlAppBar from '../shared-components/control-app-bar.svelte';
import GalleryViewer from '../shared-components/gallery-viewer/gallery-viewer.svelte'; import GalleryViewer from '../shared-components/gallery-viewer/gallery-viewer.svelte';
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
import ImmichLogo from '../shared-components/immich-logo.svelte'; import ImmichLogo from '../shared-components/immich-logo.svelte';
import { import {
notificationController, notificationController,
@ -53,12 +54,19 @@
handleError(e, 'Unable to add assets to shared link'); handleError(e, 'Unable to add assets to shared link');
} }
}; };
const handleSelectAll = () => {
selectedAssets = new Set(assets);
};
</script> </script>
<section class="bg-immich-bg dark:bg-immich-dark-bg"> <section class="bg-immich-bg dark:bg-immich-dark-bg">
{#if isMultiSelectionMode} {#if isMultiSelectionMode}
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}> <AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
<DownloadAction filename="immich-shared" sharedLinkKey={sharedLink.key} /> <CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll} />
{#if sharedLink?.allowDownload}
<DownloadAction filename="immich-shared" sharedLinkKey={sharedLink.key} />
{/if}
{#if isOwned} {#if isOwned}
<RemoveFromSharedLink bind:sharedLink /> <RemoveFromSharedLink bind:sharedLink />
{/if} {/if}