improve performance when quickly switching notes (by e.g. holding down arrow in the tree)

This commit is contained in:
azivner
2018-10-31 19:08:31 +01:00
parent 5872146172
commit 63edde8a73
2 changed files with 18 additions and 5 deletions

View File

@@ -332,13 +332,14 @@ function initFancyTree(tree) {
}
},
activate: (event, data) => {
const node = data.node.data;
const node = data.node;
const noteId = node.data.noteId;
setCurrentNotePathToHash(data.node);
setCurrentNotePathToHash(node);
noteDetailService.switchToNote(node.noteId);
noteDetailService.switchToNote(noteId);
showPaths(node.noteId, data.node);
showPaths(noteId, node);
},
expand: (event, data) => setExpandedToServer(data.node.data.branchId, true),
collapse: (event, data) => setExpandedToServer(data.node.data.branchId, false),