Commit 095e0969 authored by Joel Collins's avatar Joel Collins
Browse files

Fixed callback order for checking if data exists

parent 98229653
Loading
Loading
Loading
Loading
+19 −19
Original line number Diff line number Diff line
@@ -78,10 +78,6 @@ export default {
        .then(response => {
          this.settings =
            response.data.extensions["org.openflexure.camera_stage_mapping"];
          // Check if existing calibration data is available
          if ("get_calibration" in this.recalibrationLinks) {
            this.checkCalibrationData();
          }
        })
        .catch(error => {
          this.modalError(error); // Let mixin handle error
@@ -89,7 +85,8 @@ export default {
        });
    },

    checkCalibrationData: function() {
    updateCalibrationDataAvailability: function() {
      if ("get_calibration" in this.recalibrationLinks) {
        axios
          .get(this.recalibrationLinks.get_calibration.href)
          .then(response => {
@@ -104,6 +101,7 @@ export default {
          .catch(error => {
            this.modalError(error); // Let mixin handle error
          });
      }
    },

    getCalibrationData: function() {
@@ -137,6 +135,8 @@ export default {
          if (foundExtension) {
            // Get plugin action link
            this.recalibrationLinks = foundExtension.links;
            // Update whether calibration data is available
            this.updateCalibrationDataAvailability();
          } else {
            this.recalibrationLinks = {};
          }