diff --git a/src/js/collections/maps/viewfinder/ZoomPresets.js b/src/js/collections/maps/viewfinder/ZoomPresets.js index ec27c6071..0be1c3c72 100644 --- a/src/js/collections/maps/viewfinder/ZoomPresets.js +++ b/src/js/collections/maps/viewfinder/ZoomPresets.js @@ -32,7 +32,7 @@ define([ const zoomPresets = zoomPresetObjects.map((zoomPresetObj) => { const enabledLayerIds = []; const enabledLayerLabels = []; - for (const layer of allLayers) { + for (const layer of allLayers.models) { if ( zoomPresetObj.layerIds?.find( (id) => id === layer.get("layerId"), diff --git a/src/js/models/maps/viewfinder/ViewfinderModel.js b/src/js/models/maps/viewfinder/ViewfinderModel.js index b93dba5f4..937c41ecf 100644 --- a/src/js/models/maps/viewfinder/ViewfinderModel.js +++ b/src/js/models/maps/viewfinder/ViewfinderModel.js @@ -78,9 +78,6 @@ define([ return; } - // Unset error so the error will fire a change event even if it is the - // same error as already exists. - this.unset("error", { silent: true }); // Unset error so the error will fire a change event even if it is the // same error as already exists. this.unset("error", { silent: true }); diff --git a/test/js/specs/unit/views/maps/viewfinder/ViewfinderView.spec.js b/test/js/specs/unit/views/maps/viewfinder/ViewfinderView.spec.js index 29019948e..0a8719419 100644 --- a/test/js/specs/unit/views/maps/viewfinder/ViewfinderView.spec.js +++ b/test/js/specs/unit/views/maps/viewfinder/ViewfinderView.spec.js @@ -44,8 +44,9 @@ define([ it("shows zoom presets UI when enabled in config", () => { const view = new ViewfinderView({ - model: new Map({ zoomPresets: [{}] }), - }); + model: new Map({ zoomPresets: [{}], allLayers: { models: [] } }) + }, { parse: true }); + const harness = new ViewfinderViewHarness(view); view.render();