Move "unsaved changes" check to common hook

This commit is contained in:
Trevor Buckner
2026-09-11 23:21:21 -04:00
parent b116730925
commit b9ae2cd16c
4 changed files with 22 additions and 25 deletions
+3 -8
View File
@@ -88,7 +88,9 @@ const HomePage =(props)=>{
setWarnUnsavedChanges,
trySaveRef,
unsavedChangesRef,
sandbox
setUnsavedChanges,
sandbox,
lastSavedBrew
});
useEffect(()=>{
@@ -108,13 +110,6 @@ const HomePage =(props)=>{
});
};
useEffect(()=>{
const hasChange = !_.isEqual(currentBrew, lastSavedBrew.current);
setUnsavedChanges(hasChange);
if(autoSaveEnabled) trySave(false, hasChange);
}, [currentBrew]);
const handleSplitMove = ()=>{
editorRef.current.update();
};