Skip to content

Commit

Permalink
issue/236 Filter _isTrackable === false before save/restore (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Jun 27, 2022
1 parent 8fb4925 commit d08b01e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/serializers/ComponentSerializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ export default class ComponentSerializer extends Backbone.Controller {
return;
}
const isContainer = model.hasManagedChildren;
const components = isContainer ?
let components = isContainer ?
model.findDescendantModels('component') :
[model];
components = components.filter(component => component.get('_isTrackable') !== false);
components.forEach((component, index) => {
if (component.get('_isTrackable') === false) {
return;
Expand Down Expand Up @@ -121,9 +122,10 @@ export default class ComponentSerializer extends Backbone.Controller {
return;
}
const isContainer = model.hasManagedChildren;
const components = isContainer ?
let components = isContainer ?
model.findDescendantModels('component') :
[model];
components = components.filter(component => component.get('_isTrackable') !== false);
const component = components[index];
if (!component) {
logging.warn(`SPOOR could not restore tracking id: ${trackingId}, index: ${index}`);
Expand Down

0 comments on commit d08b01e

Please sign in to comment.