Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): delete action from full-screen reset view port in gallery view #15469

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abaroni
Copy link

@abaroni abaroni commented Jan 20, 2025

The existing action handler "onAction" is called after an action is performed.

preAction({ type: AssetAction.TRASH, asset });
await deleteAssets({ assetBulkDeleteDto: { ids: [asset.id] } });
onAction({ type: AssetAction.TRASH, asset });

This creates a problem in handling the delete, where the code that needs the information on the asset to be deleted is executed too late, causing this bug #14647

This PR introduces the preAction handler and moves the delete handling logic from the onAction to the preAction

@alextran1502 alextran1502 changed the title fix(web): 14647 Performing "delete" from full-screen view takes clien… fix(web): delete action from full-screen reset view port in gallery view Jan 20, 2025
@alextran1502
Copy link
Contributor

Hello, can you help explain the logic behind the changes with a few words in the PR's description? Thank you

@abaroni
Copy link
Author

abaroni commented Jan 22, 2025

Hello, can you help explain the logic behind the changes with a few words in the PR's description? Thank you

I added a description to the PR.
If the proposed solution sounds ok, should the preAction be added to all the actions? It's not strictly needed to solve the bug, but I honestly think it should be (that's why I created this PR as draft).

@abaroni
Copy link
Author

abaroni commented Jan 26, 2025

Hello! Any feedback on this? I ask just because if I'm on the right track I'd love to contribute more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants