diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index 1f37e37100..040ea7cf08 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -422,6 +422,13 @@ class Editor extends React.Component { this.setState({ showQuerySearchField: !this.state.showQuerySearchField }); } + onVersionDeploy = (versionId) => { + this.setState({ app: { + ...this.state.app, + current_version_id: versionId + }}) + } + render() { const { currentSidebarTab, @@ -561,13 +568,19 @@ class Editor extends React.Component { handleSlugChange={this.handleSlugChange} />}
- + Launch
{this.state.app && ( - + )}
diff --git a/frontend/src/Editor/SaveAndPreview.jsx b/frontend/src/Editor/SaveAndPreview.jsx index 40648d0029..d679c4853c 100644 --- a/frontend/src/Editor/SaveAndPreview.jsx +++ b/frontend/src/Editor/SaveAndPreview.jsx @@ -14,7 +14,7 @@ class SaveAndPreview extends React.Component { showModal: false, appId: props.appId, isLoading: true, - showVersionForm: false + showVersionForm: false, }; } @@ -65,7 +65,10 @@ class SaveAndPreview extends React.Component { appService.saveApp(this.props.appId, { name: this.props.appName, current_version_id: versionId }).then(() => { this.setState({ isDeploying: false }); toast.success('Version Deployed', { hideProgressBar: true, position: 'top-center' }); + + this.props.onVersionDeploy(versionId); }); + }; render() {