Move googleDrive button into common hook

This commit is contained in:
Trevor Buckner committed 2026-10-07 17:58:04 +00:00
1 parent a50dda6377
commit 0281e4e309
4 files changed
+86 -99

No files matched your search

+1 -4
View File
@@ -23,12 +23,11 @@ const NewPage = (props)=>{
};
const [currentBrew, setCurrentBrew] = useState(props.brew);
const [saveGoogle, setSaveGoogle] = useState(global.account?.googleId ? true : false);
const [error, setError] = useState(null);
const save = async (brew, saveToGoogle)=>{
const res = await request
.post(`/api${saveGoogle ? '?saveToGoogle=true' : ''}`)
.post(`/api${saveToGoogle ? '?saveToGoogle=true' : ''}`)
.send(brew)
.catch((err)=>{
console.error('Error Updating Local Brew');
@@ -47,8 +46,6 @@ const NewPage = (props)=>{
const {
renderPanels
} = useCommonEditPageFunctions({
saveGoogle,
setSaveGoogle,
error,
setError,
currentBrew,