Make "brewToSave" prep (patch/hash/pageCount) common, and move into common hook.

This commit is contained in:
Trevor Buckner
2026-10-07 16:07:15 +00:00
parent 829c82cb72
commit 2dc088cd80
4 changed files with 16 additions and 33 deletions
@@ -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,