mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-18 09:48:44 +00:00
Move currentBrew/lastSavedBrew update after saving to common hook
This commit is contained in:
@@ -23,8 +23,8 @@ const NewPage = (props)=>{
|
||||
};
|
||||
|
||||
const [currentBrew, setCurrentBrew] = useState(props.brew);
|
||||
const [saveGoogle, setSaveGoogle] = useState(global.account?.googleId ? true : false);
|
||||
const [error, setError] = useState(null);
|
||||
const [saveGoogle, setSaveGoogle] = useState(global.account?.googleId ? true : false);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
const lastSavedBrew = useRef(_.cloneDeep(props.brew));
|
||||
|
||||
@@ -46,11 +46,6 @@ const NewPage = (props)=>{
|
||||
});
|
||||
if(!res) return;
|
||||
|
||||
setCurrentBrew((prevBrew)=>({
|
||||
...prevBrew,
|
||||
...res.body
|
||||
}));
|
||||
|
||||
return res.body;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user