add note attribute cache to speed up tree loading

This commit is contained in:
zadam
2020-05-02 18:19:41 +02:00
parent ed52f93bbb
commit 9be1d1f697
4 changed files with 61 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ import Branch from "../entities/branch.js";
import Attribute from "../entities/attribute.js";
import options from "./options.js";
import treeCache from "./tree_cache.js";
import noteAttributeCache from "./note_attribute_cache.js";
const $outstandingSyncsCount = $("#outstanding-syncs-count");
@@ -359,6 +360,10 @@ async function processSyncRows(syncRows) {
});
if (!loadResults.isEmpty()) {
if (loadResults.hasAttributeRelatedChanges()) {
noteAttributeCache.invalidate();
}
const appContext = (await import("./app_context.js")).default;
await appContext.triggerEvent('entitiesReloaded', {loadResults});
}