fix(web): delete action closes asset viewer in asset view (#15469)
fixes #14647
This commit is contained in:
committed by
GitHub
parent
e2c34f17ba
commit
f89e74181b
@@ -19,3 +19,4 @@ export type Action = {
|
||||
[K in AssetAction]: { type: K } & ActionMap[K];
|
||||
}[AssetAction];
|
||||
export type OnAction = (action: Action) => void;
|
||||
export type PreAction = (action: Action) => void;
|
||||
|
||||
@@ -14,14 +14,15 @@
|
||||
import { deleteAssets, type AssetResponseDto } from '@immich/sdk';
|
||||
import { mdiDeleteForeverOutline, mdiDeleteOutline } from '@mdi/js';
|
||||
import { t } from 'svelte-i18n';
|
||||
import type { OnAction } from './action';
|
||||
import type { OnAction, PreAction } from './action';
|
||||
|
||||
interface Props {
|
||||
asset: AssetResponseDto;
|
||||
onAction: OnAction;
|
||||
preAction: PreAction;
|
||||
}
|
||||
|
||||
let { asset, onAction }: Props = $props();
|
||||
let { asset, onAction, preAction }: Props = $props();
|
||||
|
||||
let showConfirmModal = $state(false);
|
||||
|
||||
@@ -41,6 +42,7 @@
|
||||
|
||||
const trashAsset = async () => {
|
||||
try {
|
||||
preAction({ type: AssetAction.TRASH, asset });
|
||||
await deleteAssets({ assetBulkDeleteDto: { ids: [asset.id] } });
|
||||
onAction({ type: AssetAction.TRASH, asset });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user