From 6a4ea2c6c92cc812002b3930c3ba1cad8fc0e71a Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 11 Nov 2025 22:06:44 +1300 Subject: [PATCH] Move toggleGoogleStorage's trySave call to useEffect block --- client/homebrew/pages/editPage/editPage.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index 524f31ac9..99567ea24 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -119,6 +119,10 @@ const EditPage = (props)=>{ if(autoSaveEnabled) trySave(false, hasChange); }, [currentBrew]); + useEffect(()=>{ + trySave(true); + }, [saveGoogle]); + const handleSplitMove = ()=>{ editorRef.current?.update(); }; @@ -179,7 +183,6 @@ const EditPage = (props)=>{ const toggleGoogleStorage = ()=>{ setSaveGoogle((prev)=>!prev); setError(null); - trySave(true); }; const trySave = (immediate = false, hasChanges = true)=>{