treecache now manages reloading when starting protected session

This commit is contained in:
zadam
2020-02-01 22:29:32 +01:00
parent 513ce1a183
commit 0054a32dc7
17 changed files with 76 additions and 75 deletions

View File

@@ -37,6 +37,7 @@ async function setNodeTitleWithPrefix(node) {
node.setTitle(utils.escapeHtml(title));
}
// FIXME: unused?
/** @return {FancytreeNode} */
async function activateNote(notePath, noteLoadedListener) {
utils.assertArguments(notePath);
@@ -291,14 +292,6 @@ function getHashValueFromAddress() {
return str.split("-");
}
async function loadTreeData() {
const resp = await server.get('tree');
treeCache.load(resp.notes, resp.branches, resp.attributes);
return await treeBuilder.prepareTree();
}
function setProtected(noteId, isProtected) {
appContext.getMainNoteTree().getNodesByNoteId(noteId).map(node => {
node.data.isProtected = isProtected;
@@ -595,7 +588,6 @@ export default {
setPrefix,
createNote,
sortAlphabetically,
loadTreeData,
treeInitialized,
resolveNotePath,
getSomeNotePath,