diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index fa755aa5d..f3fad3f53 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -63,7 +63,7 @@ const EditPage = createClass({ errors : null, htmlErrors : Markdown.validate(this.props.brew.text), url : '', - autoSave : null + autoSave : true }; }, savedBrew : null, @@ -339,6 +339,9 @@ const EditPage = createClass({ if(this.state.isPending && this.hasChanges()){ return Save Now; } + if(!this.state.isPending && !this.state.isSaving && this.state.autoSave){ + return auto-saved.; + } if(!this.state.isPending && !this.state.isSaving){ return saved.; } @@ -347,8 +350,10 @@ const EditPage = createClass({ handleAutoSave : function(){ this.setState((prevState)=>({ autoSave : !prevState.autoSave - })); - localStorage.setItem('AUTOSAVE_ON', JSON.stringify(!this.state.autoSave)); + }), ()=>{ + this.trySave(); + localStorage.setItem('AUTOSAVE_ON', JSON.stringify(this.state.autoSave)); + }); }, renderAutoSaveButton : function(){