Refactor onSave and onCancel to track both layout and widgetArray useState() in order to restore state on cancel

This commit is contained in:
Daniel S. Hansen
2025-08-11 14:40:05 -07:00
parent c1787d7871
commit 77bba49dc8
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -19,9 +19,8 @@ export default function Dashboard() {
const beginEditIfNeeded = () => {
if ( !isEditable ) {
// Save deep copies to preserve state
setOriginalLayout(structuredClone(layout));
setOriginalWidgets(structuredClone(widgetArray));
setOriginalLayout(layout);
setOriginalWidgets(widgetArray);
setIsEditable(true);
setIsDelete(false);
}