From 24aa2fd5faadb5b9b27a13ffe058c69c3c16f9d6 Mon Sep 17 00:00:00 2001 From: pathmapper Date: Mon, 5 Nov 2018 08:17:21 +0100 Subject: [PATCH] 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 = () => {