From 3b82742c1891080181ffb5b1e0360311e296ebd7 Mon Sep 17 00:00:00 2001 From: Francesco Frassinelli Date: Fri, 13 May 2022 00:57:06 +0200 Subject: [PATCH] Add "Remove nodes" button --- web/src/components/actions.js | 13 ++++++++++++- web/src/constants.js | 1 + web/src/main.js | 5 +++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/web/src/components/actions.js b/web/src/components/actions.js index dc76a2b..2b2c97d 100644 --- a/web/src/components/actions.js +++ b/web/src/components/actions.js @@ -6,6 +6,7 @@ const classNames = require('classnames'); function Actions({ state, setState }) { const busy = state === states.LOADING; + const loaded = state === states.LOADED; return ( <> + {state === states.ERROR ? (

Something went wrong! Please try again later or{' '} diff --git a/web/src/constants.js b/web/src/constants.js index f910127..4325230 100644 --- a/web/src/constants.js +++ b/web/src/constants.js @@ -7,6 +7,7 @@ export const tileURL = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; export const dataTileURL = 'tiles/{z}/{x}/{y}.png'; export const states = { + CLEAN: 'clean', LOADING: 'loading', LOADED: 'loaded', ERROR: 'error', diff --git a/web/src/main.js b/web/src/main.js index d8eae3f..d8959de 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -48,12 +48,13 @@ function App() { } }); break; - case states.LOADED: - break; case states.ERROR: + case states.CLEAN: setBoundsLoaded(); setDownloadLink(null); + setGeojson(null); break; + case states.LOADED: default: break; }