@abi-software/flatmapvuer 0.3.13-beta-2 → 0.3.13-beta-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmapvuer",
3
- "version": "0.3.11",
3
+ "version": "0.3.13-beta-2",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmapvuer",
3
- "version": "0.3.13-beta-2",
3
+ "version": "0.3.13-beta-3",
4
4
  "main": "./dist/flatmapvuer.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -702,11 +702,9 @@ export default {
702
702
  }
703
703
  });
704
704
  } else if (state) {
705
- if (this.entry == state.entry) {
706
- this._stateToBeSet = { viewport: state.viewport, searchTerm: state.searchTerm };
707
- if (this.mapImp && !this.loading)
708
- this.restoreMapState(this._stateToBeSet);
709
- }
705
+ this._stateToBeSet = { viewport: state.viewport, searchTerm: state.searchTerm };
706
+ if (this.mapImp && !this.loading)
707
+ this.restoreMapState(this._stateToBeSet);
710
708
  }
711
709
  },
712
710
  showMinimap: function(flag) {
@@ -86,6 +86,8 @@ export default {
86
86
  FlatmapVuer
87
87
  },
88
88
  beforeMount() {
89
+ //List for resolving the promise in initialise
90
+ //if initialise is called multiple times
89
91
  this._resolveList = [];
90
92
  this._initialised = false;
91
93
  },
@@ -104,7 +106,6 @@ export default {
104
106
  fetch(this.flatmapAPI)
105
107
  .then(response => response.json())
106
108
  .then(data => {
107
- this._initialised = true;
108
109
  //Check each key in the provided availableSpecies against the one
109
110
  //on the server, add them to the Select if the key is found
110
111
  Object.keys(this.availableSpecies).forEach(key => {
@@ -141,14 +142,16 @@ export default {
141
142
  }
142
143
  this.setSpecies(this.activeSpecies, this.state ? this.state.state : undefined, 5);
143
144
  }
145
+ this._initialised = true;
144
146
  resolve();
147
+ //Resolve all other promises resolve in the list
145
148
  this._resolveList.forEach(other => { other(); });
146
149
  });
147
150
  } else if (this._initialised) {
148
151
  //resolve as it has been initialised
149
152
  resolve();
150
153
  } else {
151
- //resolve when the list request has been resolved
154
+ //resolve when the async initialisation is finished
152
155
  this._resolveList.push(resolve);
153
156
  }
154
157
  })