Skip to content

Commit 416f4b4

Browse files
committed
Update reference counter when loading json session
1 parent 1cf53b2 commit 416f4b4

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

js/composite_loader.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ const compositeLoader = class {
218218
};
219219
return {composites, ids}
220220
}
221+
222+
updateReferenceCounter() {
223+
this.referenceCounter = {};
224+
for (const compositeDataObj of dataObj.compositeData) {
225+
for (const id of compositeDataObj.ids) {
226+
if (id in this.referenceCounter) {
227+
this.referenceCounter[id]++
228+
} else {
229+
this.referenceCounter[id] = 1
230+
}
231+
}
232+
}
233+
}
221234
};
222235

223236
const compositeLoaderObj = new compositeLoader();

js/update_all.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const updateAll = function() {
22
tableObj.loadFromDataObject();
3+
compositeLoaderObj.updateReferenceCounter();
34
xAxisInputObj.update();
45
yAxisInputObj.update();
56
lockAxesObj.update();

0 commit comments

Comments
 (0)