mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-19 20:18:22 +00:00
Make "brewToSave" prep (patch/hash/pageCount) common, and move into common hook.
This commit is contained in:
@@ -26,8 +26,6 @@ const HomePage =(props)=>{
|
||||
const [saveGoogle, setSaveGoogle] = useState(global.account?.googleId ? true : false);
|
||||
const [error, setError] = useState(undefined);
|
||||
|
||||
const lastSavedBrew = useRef(_.cloneDeep(props.brew));
|
||||
|
||||
const save = async (brew, saveToGoogle)=>{
|
||||
const res = await request
|
||||
.post(`/api${saveGoogle ? '?saveToGoogle=true' : ''}`)
|
||||
@@ -58,7 +56,6 @@ const HomePage =(props)=>{
|
||||
useLocalStorage,
|
||||
sandbox,
|
||||
showFloatingButtons,
|
||||
lastSavedBrew,
|
||||
save,
|
||||
onSaveSuccess,
|
||||
pageName,
|
||||
|
||||
Reference in New Issue
Block a user