frontend sync fixes

This commit is contained in:
zadam 2020-02-09 21:53:10 +01:00
parent 826c434630
commit 99ea238c3f
3 changed files with 6 additions and 6 deletions

View File

@ -201,7 +201,7 @@ subscribeToMessages(message => {
});
async function processSyncRows(syncRows) {
const loadResults = new LoadResults(this);
const loadResults = new LoadResults(treeCache);
syncRows.filter(sync => sync.entityName === 'notes').forEach(sync => {
const note = treeCache.notes[sync.entityId];
@ -244,7 +244,7 @@ async function processSyncRows(syncRows) {
}
else if (!sync.entity.isDeleted) {
if (childNote || parentNote) {
branch = new Branch(this, sync.entity);
branch = new Branch(treeCache, sync.entity);
treeCache.branches[branch.branchId] = branch;
loadResults.addBranch(sync.entityId, sync.sourceId);
@ -294,7 +294,7 @@ async function processSyncRows(syncRows) {
}
else if (!sync.entity.isDeleted) {
if (sourceNote || targetNote) {
attribute = new Attribute(this, sync.entity);
attribute = new Attribute(treeCache, sync.entity);
treeCache.attributes[attribute.attributeId] = attribute;

View File

@ -404,7 +404,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
await this.tree.reload(notes);
}
createTopLevelNoteListener() { treeService.createNewTopLevelNote(); }
createTopLevelNoteListener() { noteCreateService.createNewTopLevelNote(); }
collapseTreeListener() { this.collapseTree(); }

View File

@ -45,7 +45,7 @@ export default class TabCachingWidget extends TabAwareWidget {
widget.eventReceived('setTabContext', {tabContext: this.tabContext});
}
widget.toggle(true);
widget.toggle(widget.isEnabled());
}
tabRemovedListener({tabId}) {
@ -63,7 +63,7 @@ export default class TabCachingWidget extends TabAwareWidget {
for (const tabId in this.widgets) {
this.widgets[tabId].toggle(
show
&& this.tabContext && tabId === this.tabContext.tabId
&& this.isTab(tabId)
&& this.widgets[tabId].isEnabled());
}
}