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:
Yousefa7medmaher 2025-09-22 12:57:39 +03:00
parent 02569d52f0
commit 63dbf56a70

View file

@ -245,13 +245,20 @@
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));
};
const onForceDelete = () => {
if ($showDeleteModal) {
isShowDeleteConfirmation = true;