fix: reset current path if deleted#1765
Merged
Merged
Conversation
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #1764 by resetting the current directory path when the displayed folder (or its parent) is deleted, preventing users from being stuck viewing a non-existent directory.
- Added type safety with TypeScript annotations to
setCurrentPathmutation andupdateCurrentPathByRootaction - Enhanced
notifyDeleteDiraction to detect when the current view path matches the deleted folder or is within it - Automatically navigates to the parent directory when current location is deleted
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/store/files/mutations.ts | Added type annotation to setCurrentPath mutation for improved type safety |
| src/store/files/actions.ts | Added logic in notifyDeleteDir to reset current path to parent when viewing deleted folder; added type annotations to payload parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Will check get the root of the deleted folder and if the current path includes it, it resets to the parent path.
Fixes #1764