Skip to content

Commit

Permalink
Bug fix, newly renamed files were causing duplicate selection
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasgauvin committed Feb 18, 2024
1 parent 566060b commit eb2ef3c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions sample-markdown-folder/✅ Todo list.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@
* hide images from folder view ✅


### Bugs:

* Rename files issue causing duplicate selected files ✅

* Renaming a folder does not update the folder directory

* Folder view should not have a Editor view, or the Editor view should be functional to rename a folder

* Easier way to go from title to text. Maybe enter should go to text, or tab.


### P1

* Support ignoring frontmatter ✅
Expand Down
6 changes: 5 additions & 1 deletion src/models/DirectoryNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,15 @@ class DirectoryNode {
//@ts-ignore
await this.fileHandle.move(newFileName);

//update the current node with the new file name
const oldName = this.name;
this.name = newFileName;

console.log("renamed file, updating name", this.fileHandle.name);

//update the children of the parent
this.parent.children = this.parent.children.map((child) => {
if (child.name === this.name) {
if (child.name === oldName) {
return this;
} else {
return child;
Expand Down

0 comments on commit eb2ef3c

Please sign in to comment.