diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte
index ffc2c5bbf2..fc298f471d 100644
--- a/web/src/lib/components/asset-viewer/asset-viewer.svelte
+++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte
@@ -20,10 +20,9 @@
import VideoViewer from './video-viewer.svelte';
import PanoramaViewer from './panorama-viewer.svelte';
import { AppRoute, AssetAction, ProjectionType } from '$lib/constants';
- import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
import ProfileImageCropper from '../shared-components/profile-image-cropper.svelte';
- import { isShowDetail } from '$lib/stores/preferences.store';
- import { addAssetsToAlbum, downloadFile, getAssetType } from '$lib/utils/asset-utils';
+ import { isShowDetail, showDeleteModal } from '$lib/stores/preferences.store';
+ import { addAssetsToAlbum, downloadFile } from '$lib/utils/asset-utils';
import NavigationArea from './navigation-area.svelte';
import { browser } from '$app/environment';
import { handleError } from '$lib/utils/handle-error';
@@ -42,13 +41,13 @@
import { SlideshowState, slideshowStore } from '$lib/stores/slideshow.store';
import SlideshowBar from './slideshow-bar.svelte';
import { user } from '$lib/stores/user.store';
+ import DeleteAssetDialog from '../photos-page/delete-asset-dialog.svelte';
export let assetStore: AssetStore | null = null;
export let asset: AssetResponseDto;
export let showNavigation = true;
export let sharedLink: SharedLinkResponseDto | undefined = undefined;
$: isTrashEnabled = $featureFlags.trash;
- export let force = false;
export let withStacked = false;
export let isShared = false;
export let album: AlbumResponseDto | null = null;
@@ -279,7 +278,7 @@
}
return;
case 'Delete':
- trashOrDelete();
+ trashOrDelete(shiftKey);
return;
case 'Escape':
if (isShowDeleteConfirmation) {
@@ -360,11 +359,19 @@
$isShowDetail = !$isShowDetail;
};
- $: trashOrDelete = !(force || !isTrashEnabled)
- ? trashAsset
- : () => {
+ const trashOrDelete = (force: boolean = false) => {
+ if (force || !isTrashEnabled) {
+ if ($showDeleteModal) {
isShowDeleteConfirmation = true;
- };
+ return;
+ }
+ deleteAsset();
+ return;
+ }
+
+ trashAsset();
+ return;
+ };
const trashAsset = async () => {
try {
@@ -576,7 +583,7 @@
on:back={closeViewer}
on:showDetail={showDetailInfoHandler}
on:download={() => downloadFile(asset)}
- on:delete={trashOrDelete}
+ on:delete={() => trashOrDelete()}
on:favorite={toggleFavorite}
on:addToAlbum={() => openAlbumPicker(false)}
on:addToSharedAlbum={() => openAlbumPicker(true)}
@@ -764,20 +771,12 @@
{/if}
{#if isShowDeleteConfirmation}
- (isShowDeleteConfirmation = false)}
- >
-
-
- Are you sure you want to delete this {getAssetType(asset.type).toLowerCase()}? This will also remove it from
- its album(s).
-
-
You cannot undo this action!
-
-
+ on:escape={() => (isShowDeleteConfirmation = false)}
+ on:confirm={() => deleteAsset()}
+ />
{/if}
{#if isShowProfileImageCrop}
diff --git a/web/src/lib/components/photos-page/actions/archive-action.svelte b/web/src/lib/components/photos-page/actions/archive-action.svelte
index a72bc106ab..fc3739c4e6 100644
--- a/web/src/lib/components/photos-page/actions/archive-action.svelte
+++ b/web/src/lib/components/photos-page/actions/archive-action.svelte
@@ -7,8 +7,9 @@
import { handleError } from '$lib/utils/handle-error';
import { api } from '@api';
import MenuOption from '../../shared-components/context-menu/menu-option.svelte';
- import { OnArchive, getAssetControlContext } from '../asset-select-control-bar.svelte';
+ import { getAssetControlContext } from '../asset-select-control-bar.svelte';
import { mdiArchiveArrowUpOutline, mdiArchiveArrowDownOutline, mdiTimerSand } from '@mdi/js';
+ import type { OnArchive } from '$lib/utils/actions';
export let onArchive: OnArchive | undefined = undefined;
diff --git a/web/src/lib/components/photos-page/actions/delete-assets.svelte b/web/src/lib/components/photos-page/actions/delete-assets.svelte
index 02fbdaeed3..a43f5de02b 100644
--- a/web/src/lib/components/photos-page/actions/delete-assets.svelte
+++ b/web/src/lib/components/photos-page/actions/delete-assets.svelte
@@ -1,23 +1,18 @@
+
+ dispatch('cancel')}
+ on:escape={() => dispatch('cancel')}
+>
+
+
+ Are you sure you want to permanently delete
+ {#if size > 1}
+ these {size} assets? This will also remove them from their album(s).
+ {:else}
+ this asset? This will also remove it from its album(s).
+ {/if}
+