mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-17 23:21:31 +00:00
EditPage: Consistent trySave on handle[Metadata|Text]change
Previously, one of these happened in React's post-state-update callback, while the other happened directly. They now both use the callback.
This commit is contained in:
@@ -94,9 +94,7 @@ const EditPage = createClass({
|
|||||||
this.setState((prevState)=>({
|
this.setState((prevState)=>({
|
||||||
brew : _.merge({}, prevState.brew, metadata),
|
brew : _.merge({}, prevState.brew, metadata),
|
||||||
isPending : true,
|
isPending : true,
|
||||||
}), ()=>{
|
}), ()=>this.trySave());
|
||||||
this.trySave();
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -110,9 +108,7 @@ const EditPage = createClass({
|
|||||||
brew : _.merge({}, prevState.brew, { text: text }),
|
brew : _.merge({}, prevState.brew, { text: text }),
|
||||||
isPending : true,
|
isPending : true,
|
||||||
htmlErrors : htmlErrors
|
htmlErrors : htmlErrors
|
||||||
}));
|
}), ()=>this.trySave());
|
||||||
|
|
||||||
this.trySave();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
hasChanges : function(){
|
hasChanges : function(){
|
||||||
|
|||||||
Reference in New Issue
Block a user