Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Fix error with loading palette requirements with in-progress story

ZachTRice678714ad949c
diff --git a/web/js/app.js b/web/js/app.js
index 8782f83a4..a62cfbd6d 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -348,7 +348,7 @@ class App extends React.Component {
lodashEach(parsers, function(parser) {
parser(state, errors, config);
});
- requirements = [palettes.requirements(state, config)];
+ requirements = [palettes.requirements(state, config, true)];
$.when
.apply(null, requirements)
diff --git a/web/js/components/tour/modal-tour-in-progress.js b/web/js/components/tour/modal-tour-in-progress.js
index ee850aa82..463d286e9 100644
--- a/web/js/components/tour/modal-tour-in-progress.js
+++ b/web/js/components/tour/modal-tour-in-progress.js
@@ -4,7 +4,6 @@ import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import Steps from './widget-steps';
import util from '../../util/util';
import lodashEach from 'lodash/each';
-import lodashDebounce from 'lodash/debounce';
import { getCompareObjects } from '../../compare/util';
import { parse as dateParser } from '../../date/date';
import {
@@ -27,7 +26,7 @@ class ModalInProgress extends React.Component {
error: null
};
this.fetchMetadata = this.fetchMetadata.bind(this);
- this.processLink = lodashDebounce(this.processLink.bind(this), 200);
+ this.processLink = this.processLink.bind(this);
this.loadLink = this.loadLink.bind(this);
this.setUI = this.setUI.bind(this);
this.processActions = this.processActions.bind(this);
diff --git a/web/js/palettes/palettes.js b/web/js/palettes/palettes.js
index ee3c39319..71e9a2db9 100644
--- a/web/js/palettes/palettes.js
+++ b/web/js/palettes/palettes.js
@@ -113,9 +113,9 @@ export default (function(self) {
'config/palettes/' + layer.palette.id + '.json'
);
};
- self.requirements = function(state, config) {
+ self.requirements = function(state, config, startup) {
var promises = [];
- if (!state.tr) {
+ if (startup || !state.tr) {
config.palettes = {
rendered: {},
custom: {}
diff --git a/web/js/tour/ui.js b/web/js/tour/ui.js
index bf2ffb561..035c30ded 100644
--- a/web/js/tour/ui.js
+++ b/web/js/tour/ui.js
@@ -59,6 +59,11 @@ export function tourUi(models, ui, config) {
};
var initTourState = function() {
+ resetMap();
+ setTourState();
+ };
+
+ var resetMap = function() {
var leading;
var map = ui.map.selected;
@@ -74,7 +79,6 @@ export function tourUi(models, ui, config) {
map.getView().fit(leading, map.getSize());
self.resetting = false;
self.events.trigger('reset');
- setTourState();
};
var setTourState = function() {