mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix(shared-links): handle Delete key to remove assets from shared link
Previously, pressing the Delete key on selected assets in the Shared Link view sent them to trash instead of removing them from the shared link. This commit updates the `onDelete` handler in the shared link view to call the `removeFromSharedLink` function, ensuring that both the Delete key and the UI delete button correctly remove assets from the shared link.
This commit is contained in:
parent
02569d52f0
commit
63dbf56a70
1 changed files with 15 additions and 8 deletions
|
|
@ -242,15 +242,22 @@
|
|||
}
|
||||
};
|
||||
|
||||
const onDelete = () => {
|
||||
const hasTrashedAsset = assetInteraction.selectedAssets.some((asset) => asset.isTrashed);
|
||||
const onDelete = () => {
|
||||
const hasTrashedAsset = assetInteraction.selectedAssets.some((asset) => asset.isTrashed);
|
||||
|
||||
if (isSharedLinkView) {
|
||||
removeFromSharedLink(link.id, assetInteraction.selectedAssets.map(a => a.id));
|
||||
return;
|
||||
}
|
||||
|
||||
if ($showDeleteModal && (!isTrashEnabled || hasTrashedAsset)) {
|
||||
isShowDeleteConfirmation = true;
|
||||
return;
|
||||
}
|
||||
|
||||
handlePromiseError(trashOrDelete(hasTrashedAsset));
|
||||
};
|
||||
|
||||
if ($showDeleteModal && (!isTrashEnabled || hasTrashedAsset)) {
|
||||
isShowDeleteConfirmation = true;
|
||||
return;
|
||||
}
|
||||
handlePromiseError(trashOrDelete(hasTrashedAsset));
|
||||
};
|
||||
|
||||
const onForceDelete = () => {
|
||||
if ($showDeleteModal) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue