mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-07 07:42:39 +00:00
Don't save unless previous save is complete
This commit is contained in:
@@ -197,7 +197,7 @@ const EditPage = createClass({
|
|||||||
|
|
||||||
trySave : function(immediate=false){
|
trySave : function(immediate=false){
|
||||||
if(!this.debounceSave) this.debounceSave = _.debounce(this.save, SAVE_TIMEOUT);
|
if(!this.debounceSave) this.debounceSave = _.debounce(this.save, SAVE_TIMEOUT);
|
||||||
if(this.hasChanges()){
|
if(this.hasChanges() && !this.state.isSaving){
|
||||||
this.debounceSave();
|
this.debounceSave();
|
||||||
} else {
|
} else {
|
||||||
this.debounceSave.cancel();
|
this.debounceSave.cancel();
|
||||||
@@ -216,8 +216,7 @@ const EditPage = createClass({
|
|||||||
confirmGoogleTransfer : !prevState.confirmGoogleTransfer
|
confirmGoogleTransfer : !prevState.confirmGoogleTransfer
|
||||||
}));
|
}));
|
||||||
this.setState({
|
this.setState({
|
||||||
error : null,
|
error : null
|
||||||
isSaving : false
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -233,9 +232,8 @@ const EditPage = createClass({
|
|||||||
toggleGoogleStorage : function(){
|
toggleGoogleStorage : function(){
|
||||||
this.setState((prevState)=>({
|
this.setState((prevState)=>({
|
||||||
saveGoogle : !prevState.saveGoogle,
|
saveGoogle : !prevState.saveGoogle,
|
||||||
isSaving : false,
|
|
||||||
error : null
|
error : null
|
||||||
}), ()=>this.save());
|
}), ()=>this.trySave(true));
|
||||||
},
|
},
|
||||||
|
|
||||||
save : async function(){
|
save : async function(){
|
||||||
|
|||||||
Reference in New Issue
Block a user