Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Removed auto when custom selected (#6531)

christof-wittreichf23c7bbc2420
diff --git a/web/js/location.js b/web/js/location.js
index cac197a7d..f7870b494 100644
--- a/web/js/location.js
+++ b/web/js/location.js
@@ -200,6 +200,13 @@ const getParameters = function(config, parameters) {
serializeNeedsGlobalState: true,
serialize: (currentItemState, state) => {
let interval = currentItemState;
+ const isCustomSelected = get(state, 'date.customSelected');
+ const customDelta = get(state, 'date.customDelta');
+ const customInterval = get(state, 'date.customInterval');
+ // check if custom interval is equivalent to a normal interval to fall-back if available
+ if (isCustomSelected && customDelta === 1 && customInterval) {
+ interval = customInterval;
+ }
// check if subdaily timescale zoom to determine if reset is needed
if (interval > 3) {
if (!subdailyLayersActive(state)) {
@@ -219,7 +226,7 @@ const getParameters = function(config, parameters) {
serialize: (currentItemState, state) => {
const customDelta = get(state, 'date.customDelta');
const customInterval = get(state, 'date.customInterval');
- if (customDelta === 1 && customInterval === 3) {
+ if (customDelta === 1 && customInterval) {
return undefined;
}
return currentItemState;
diff --git a/web/js/modules/date/reducers.js b/web/js/modules/date/reducers.js
index a016061c8..af34fa0ed 100644
--- a/web/js/modules/date/reducers.js
+++ b/web/js/modules/date/reducers.js
@@ -60,6 +60,7 @@ export function dateReducer(state = dateReducerState, action) {
customInterval: interval,
customDelta: delta,
customSelected: !(!interval && !delta),
+ autoSelected: false,
};
}
case CHANGE_AUTO_INTERVAL: {
@@ -67,6 +68,7 @@ export function dateReducer(state = dateReducerState, action) {
return {
...state,
autoSelected,
+ customSelected: false,
};
}
case CHANGE_INTERVAL: