Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 96631e3

Browse files
fix : redo를 트리거할 때 undo도 함께 트리거되던 문제 해결
1 parent f8a5696 commit 96631e3

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

‎client/src/components/MindMapCanvas/ToolMenu.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type ToolMenuProps = {
1919
setDragmode: React.Dispatch<React.SetStateAction<boolean>>;
2020
};
2121
export default function ToolMenu({ dimensions, zoomIn, zoomOut, dragmode, setDragmode }: ToolMenuProps) {
22-
const { data, selectNode, selectedNode, saveHistory,overrideNodeData } = useNodeListContext();
22+
const { data, selectNode, selectedNode, overrideNodeData } = useNodeListContext();
2323
const intervalRef = useRef(null);
2424

2525
const startZoom = (zoomFn) => {

‎client/src/components/MindMapCanvas/index.tsx‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ export default function MindMapCanvas({ showMinutes, handleShowMinutes }) {
5252
useWindowEventListener("keydown", (e) => {
5353
e.preventDefault();
5454
if (e.metaKey || e.ctrlKey) {
55-
if (e.shiftKey && e.code === "KeyZ") redo();
56-
switch (e.code) {
57-
case "KeyZ":
58-
undo();
59-
break;
60-
case "KeyR":
61-
const url = window.location;
62-
location.href = url.pathname + url.search;
63-
break;
55+
if (e.shiftKey && e.code === "KeyZ") {
56+
redo();
57+
} else if (e.code === "KeyZ") {
58+
undo();
59+
}
60+
if (e.code === "KeyR") {
61+
const url = window.location;
62+
location.href = url.pathname + url.search;
6463
}
6564
}
6665

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /