diff --git a/frontend/src/Editor/SaveAndPreview.jsx b/frontend/src/Editor/SaveAndPreview.jsx index a47d53e971..c23191d9be 100644 --- a/frontend/src/Editor/SaveAndPreview.jsx +++ b/frontend/src/Editor/SaveAndPreview.jsx @@ -43,30 +43,34 @@ class SaveAndPreview extends React.Component { createVersion = () => { const newVersionName = this.state.newVersionName; const appId = this.props.appId; + this.setState({ creatingVersion: true }); appVersionService.create(appId, newVersionName).then(data => { - this.setState({ showVersionForm: false, }) + this.setState({ showVersionForm: false, creatingVersion: false }) toast.success('Version Created', { hideProgressBar: true, position: "top-center", }); this.fetchVersions(); }); } saveVersion = (versionId) => { + this.setState({ isSaving: true }); appVersionService.save(this.props.appId, versionId, this.props.appDefinition).then(data => { - this.setState({ showVersionForm: false, }) + this.setState({ showVersionForm: false, isSaving: false}) toast.success('Version Saved', { hideProgressBar: true, position: "top-center", }); this.fetchVersions(); }); } deployVersion = (versionId) => { + this.setState({ isDeploying: true }); appService.saveApp(this.props.appId, this.props.appName ,undefined, versionId).then(data => { + this.setState({ isDeploying: false }); toast.success('Version Deployed', { hideProgressBar: true, position: "top-center", }); }); } render() { - const { showModal, isLoading, versions , showVersionForm} = this.state; + const { showModal, isLoading, versions , showVersionForm, isSaving, isDeploying, creatingVersion } = this.state; return (