optimizations to the lazy loading - expanding tree now takes only one request

This commit is contained in:
azivner
2018-04-16 23:13:33 -04:00
parent 82de1c88d4
commit b4005a7ffe
5 changed files with 67 additions and 66 deletions

View File

@@ -5,10 +5,10 @@ import server from "./server.js";
import treeCache from "./tree_cache.js";
import messagingService from "./messaging.js";
async function prepareTree(noteRows, branchRows, parentToChildren) {
utils.assertArguments(noteRows, branchRows, parentToChildren);
async function prepareTree(noteRows, branchRows, relations) {
utils.assertArguments(noteRows, branchRows, relations);
treeCache.load(noteRows, branchRows, parentToChildren);
treeCache.load(noteRows, branchRows, relations);
return await prepareRealBranch(await treeCache.getNote('root'));
}