Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

clear custom palettes if present on tour step process

Ed Plato3d94576e5945
diff --git a/web/js/containers/tour.js b/web/js/containers/tour.js
index 74b2b81c7..7f99b001b 100644
--- a/web/js/containers/tour.js
+++ b/web/js/containers/tour.js
@@ -2,7 +2,12 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import googleTagManager from 'googleTagManager';
-import { findIndex as lodashFindIndex, get as lodashGet, uniqBy } from 'lodash';
+import {
+ findIndex as lodashFindIndex,
+ get as lodashGet,
+ uniqBy,
+ isEmpty as lodashIsEmpty,
+} from 'lodash';
import update from 'immutability-helper';
import JoyrideWrapper from '../components/tour/joyride-wrapper';
@@ -16,6 +21,9 @@ import {
preloadPalettes,
hasCustomTypePalette,
} from '../modules/palettes/util';
+import {
+ clearCustoms,
+} from '../modules/palettes/actions';
import { BULK_PALETTE_RENDERING_SUCCESS } from '../modules/palettes/constants';
import { stop as stopAnimation } from '../modules/animation/actions';
import { onClose as closeModal } from '../modules/modal/actions';
@@ -468,6 +476,9 @@ const mapDispatchToProps = (dispatch) => ({
});
dispatch(stopAnimation());
dispatch(closeModal());
+ if (!lodashIsEmpty(rendered)) {
+ dispatch(clearCustoms());
+ }
if (
(parameters.l && hasCustomTypePalette(parameters.l))
|| (parameters.l1 && hasCustomTypePalette(parameters.l1))