Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add conditions

Ed Platobd2d79eb806c
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index 51aa84743..3bf5110d0 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -868,9 +868,11 @@ class Timeline extends React.Component {
* @returns {void}
*/
toggleDataCoveragePanel = (isOpen) => {
- googleTagManager.pushEvent({
- event: 'open_data_coverage_panel',
- });
+ if (!isOpen) {
+ googleTagManager.pushEvent({
+ event: 'open_data_coverage_panel',
+ });
+ }
this.setState({
isDataCoveragePanelOpen: isOpen,
});
diff --git a/web/js/modules/ui/actions.js b/web/js/modules/ui/actions.js
index 31e652302..243fd6756 100644
--- a/web/js/modules/ui/actions.js
+++ b/web/js/modules/ui/actions.js
@@ -9,9 +9,11 @@ export default function toggleDistractionFreeMode() {
const { modal, ui } = getState();
const { isDistractionFreeModeActive } = ui;
const modalIsOpen = modal.isOpen;
- googleTagManager.pushEvent({
- event: 'init_distraction_free_mode',
- });
+ if (!isDistractionFreeModeActive) {
+ googleTagManager.pushEvent({
+ event: 'init_distraction_free_mode',
+ });
+ }
dispatch({
type: TOGGLE_DISTRACTION_FREE_MODE,
isDistractionFreeModeActive: !isDistractionFreeModeActive,