Use replaceAccessToken onStyleChanged

This commit is contained in:
pathmapper 2018-11-05 08:17:21 +01:00
parent da17646b8d
commit 24aa2fd5fa

View file

@ -258,6 +258,11 @@ export default class App extends React.Component {
this.revisionStore.addRevision(newStyle) this.revisionStore.addRevision(newStyle)
if(save) this.saveStyle(newStyle) if(save) this.saveStyle(newStyle)
this.setState({
mapStyle: style.replaceAccessTokens(newStyle, {allowFallback: true}),
errors: [],
})
this.fetchSources()
this.setState({ this.setState({
mapStyle: newStyle, mapStyle: newStyle,
errors: [], errors: [],
@ -266,9 +271,9 @@ export default class App extends React.Component {
this.setState({ this.setState({
errors: errors.map(err => err.message) errors: errors.map(err => err.message)
}) })
this.fetchSources()
} }
this.fetchSources();
} }
onUndo = () => { onUndo = () => {