fix(board): save latest edited state

This commit is contained in:
Thomas Camlong committed 2026-07-21 10:32:04 +02:00
1 parent 22b6f9ad89
commit 9370f93525
1 file changed
+2 -2
@@ -190,10 +190,10 @@ const EditModeMenu = ({ demoReadOnly }: { demoReadOnly: boolean }) => {
const toggle = useCallback(() => {
if (isEditMode) {
if (demoReadOnly) return discardDemoChanges();
return saveBoard(board);
return saveBoard(utils.board.getBoardByName.getData({ name: board.name }) ?? board);
}
open();
}, [board, isEditMode, demoReadOnly, saveBoard, open, discardDemoChanges]);
}, [board, isEditMode, demoReadOnly, saveBoard, open, discardDemoChanges, utils.board.getBoardByName]);
useHotkeys([[hotkeys.toggleBoardEdit, toggle]]);
usePreventLeaveWithDirty(isEditMode);