Fix needs saving mark for renamed: Fixes #576 #652
Closed
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.
Before your pull request is reviewed and merged, please ensure that:
npm run lint
(there are linting errors, but not in the files I have touched.)Fixes #576
This is an attempt at fixing the problem described in #576, which is that after a file in a project has been renamed, the 'needs-saving' marker is not cleared after saving. I'm mainly adding this pull request to show that it fixes the problem, but I don't think it's the best code. If I was more familiar with the lodash library, I would try and use one of the functions provided by that rather than writing my own custom comparison function.
Another option is to look at the parts of the code that set the 'isEditingName' and 'isOptionsOpen' properties after files have been renamed. These are the properties that cause the comparision between the local copy of the project and that returned by the server to be different.