Empty trash
@@ -103,18 +111,3 @@
{/if}
-
-{#if isShowEmptyConfirmation}
-
(isShowEmptyConfirmation = false)}
- >
-
- Are you sure you want to empty the trash? This will remove all the assets in trash permanently from Immich.
- You cannot undo this action!
-
-
-{/if}
diff --git a/web/src/routes/+layout.svelte b/web/src/routes/+layout.svelte
index 6fb98a4576..1303048645 100644
--- a/web/src/routes/+layout.svelte
+++ b/web/src/routes/+layout.svelte
@@ -18,6 +18,7 @@
import { onDestroy, onMount } from 'svelte';
import '../app.css';
import { isAssetViewerRoute, isSharedLinkRoute } from '$lib/utils/navigation';
+ import DialogWrapper from '$lib/components/shared-components/dialog/dialog-wrapper.svelte';
let showNavigationLoadingBar = false;
@@ -121,6 +122,7 @@
+
{#if $user?.isAdmin}
diff --git a/web/src/routes/admin/library-management/+page.svelte b/web/src/routes/admin/library-management/+page.svelte
index fe5cb2686f..714c4f3710 100644
--- a/web/src/routes/admin/library-management/+page.svelte
+++ b/web/src/routes/admin/library-management/+page.svelte
@@ -6,7 +6,6 @@
import LibraryScanSettingsForm from '$lib/components/forms/library-scan-settings-form.svelte';
import LibraryUserPickerForm from '$lib/components/forms/library-user-picker-form.svelte';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
- import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
import ContextMenu from '$lib/components/shared-components/context-menu/context-menu.svelte';
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte';
@@ -37,6 +36,7 @@
import LinkButton from '../../../lib/components/elements/buttons/link-button.svelte';
import type { PageData } from './$types';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
+ import { dialogController } from '$lib/components/shared-components/dialog/dialog';
export let data: PageData;
@@ -282,29 +282,39 @@
const onDeleteLibraryClicked = async () => {
closeAll();
- if (selectedLibrary && confirm(`Are you sure you want to delete ${selectedLibrary.name} library?`) == true) {
- await refreshStats(selectedLibraryIndex);
- if (totalCount[selectedLibraryIndex] > 0) {
- deleteAssetCount = totalCount[selectedLibraryIndex];
- confirmDeleteLibrary = selectedLibrary;
- } else {
- deletedLibrary = selectedLibrary;
- await handleDelete();
+ if (!selectedLibrary) {
+ return;
+ }
+
+ const isConfirmedLibrary = await dialogController.show({
+ id: 'delete-library',
+ prompt: `Are you sure you want to delete ${selectedLibrary.name} library?`,
+ });
+
+ if (!isConfirmedLibrary) {
+ return;
+ }
+
+ await refreshStats(selectedLibraryIndex);
+ if (totalCount[selectedLibraryIndex] > 0) {
+ deleteAssetCount = totalCount[selectedLibraryIndex];
+
+ const isConfirmedLibraryAssetCount = await dialogController.show({
+ id: 'delete-library-assets',
+ prompt: `Are you sure you want to delete this library? This will delete all ${deleteAssetCount} contained assets from Immich and cannot be undone. Files will remain on disk.`,
+ });
+
+ if (!isConfirmedLibraryAssetCount) {
+ return;
}
+ await handleDelete();
+ } else {
+ deletedLibrary = selectedLibrary;
+ await handleDelete();
}
};
-{#if confirmDeleteLibrary}
-
(confirmDeleteLibrary = null)}
- />
-{/if}
-
{#if toCreateLibrary}
handleCreate(detail.ownerId)}
diff --git a/web/src/routes/admin/user-management/+page.svelte b/web/src/routes/admin/user-management/+page.svelte
index 0875f819b9..d45c0be6c2 100644
--- a/web/src/routes/admin/user-management/+page.svelte
+++ b/web/src/routes/admin/user-management/+page.svelte
@@ -1,5 +1,6 @@