Skip to content

Commit

Permalink
fix: conflict event layerChanged was listened twice
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand committed Sep 18, 2024
1 parent 74c4bb8 commit e6f173f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions js/models/event_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export default class EventHandler {
// If the layer is added, update the WCS, FoV, survey and overlay survey
if (layerName === "base") {
this.updateWCS();
this.model.set("_survey_body", imageLayer.hipsBody || "sky");
this.model.set("_base_layer_last_view", imageLayer.url);
if (pySurveyLock.locked) {
pySurveyLock.unlock();
Expand Down Expand Up @@ -216,15 +217,6 @@ export default class EventHandler {
this.model.save_changes();
});

this.aladin.on("layerChanged", (imageLayer, layerName, state) => {
if (layerName === "base")
this.model.set("_survey_body", imageLayer.hipsBody || "sky");
if (layerName !== "base" || state !== "ADDED") return;
this.updateWCS();
this.model.set("_base_layer_last_view", imageLayer.id);
this.model.save_changes();
});

this.aladin.on("resizeChanged", (width, height) => {
// Skip resize event when the div is hidden
if (width === 1 && height === 1) {
Expand Down

0 comments on commit e6f173f

Please sign in to comment.