From 24aa2fd5faadb5b9b27a13ffe058c69c3c16f9d6 Mon Sep 17 00:00:00 2001 From: pathmapper Date: Mon, 5 Nov 2018 08:17:21 +0100 Subject: [PATCH 1/2] Use replaceAccessToken onStyleChanged --- src/components/App.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/App.jsx b/src/components/App.jsx index 6fc5ce9..06b3fec 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -258,6 +258,11 @@ export default class App extends React.Component { this.revisionStore.addRevision(newStyle) if(save) this.saveStyle(newStyle) + this.setState({ + mapStyle: style.replaceAccessTokens(newStyle, {allowFallback: true}), + errors: [], + }) + this.fetchSources() this.setState({ mapStyle: newStyle, errors: [], @@ -266,9 +271,9 @@ export default class App extends React.Component { this.setState({ errors: errors.map(err => err.message) }) + this.fetchSources() } - this.fetchSources(); } onUndo = () => { From 3acbc3291ccb1ad276940d2d854b12fe224417e7 Mon Sep 17 00:00:00 2001 From: pathmapper Date: Mon, 5 Nov 2018 21:08:34 +0100 Subject: [PATCH 2/2] Remove duplicated line --- src/components/App.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/App.jsx b/src/components/App.jsx index 06b3fec..e2d34c9 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -260,7 +260,6 @@ export default class App extends React.Component { if(save) this.saveStyle(newStyle) this.setState({ mapStyle: style.replaceAccessTokens(newStyle, {allowFallback: true}), - errors: [], }) this.fetchSources() this.setState({