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

Fail to cut and paste folder inside itself #638

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

GRFreire
Copy link
Contributor

Fails the moveElement operation when trying to move something into itself.

For now, the only thing it does is failing the operation, but does not open a modal for warning. It leaves the process cancellation (UI) to the pasteItem handler. If an modal is wanted, I can try to add to this PR, otherwise, it can be left like this - only failing but no communication to the user - with the issue solved.

Fixes #570

Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for superfile canceled.

Name Link
🔨 Latest commit ac46bdc
🔍 Latest deploy log https://app.netlify.com/sites/superfile/deploys/67b9ed9649b3210008915bdf

@lazysegtree
Copy link
Collaborator

@GRFreire Same thing is gonna happen, when you try to copy a directory into itself. So we better fix it once and for all.

@yorukot Do you think an error modal is required here ? See - #570

before, this would fail only when cuting and pasting a directory, now
the file path is checked before any pasting operation (copy, cut, etc)
@GRFreire
Copy link
Contributor Author

@GRFreire Same thing is gonna happen, when you try to copy a directory into itself. So we better fix it once and for all.

Forgot about the other types of pasting. Now it checks for the path before performing any type in elementPaste.

Still missing the tests cases thought. Never implemented a test in this project, gonna look into it.

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