Skip to content

Commit 5f8d051

Browse files
atu816neighbor-peacegeistnine01001101CK
committed
Merged
Co-authored-by: Michael Costello <[email protected]> Co-authored-by: Steven Geiger <[email protected]> Co-authored-by: Yufa Li <[email protected]> Co-authored-by: Alexander Tu <[email protected]>
2 parents 088240b + a169339 commit 5f8d051

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/components/DBDisplay/FeatureTab.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// React & React Router & React Query Modules
2+
23
import React, { useState, useRef, useEffect } from 'react';
34
import axios from 'axios';
45

6+
57
// Functions imported:
68
import parseSql from '../../parse';
79
import createEdges from '../ReactFlow/createEdges';
@@ -21,8 +23,10 @@ import QueryModal from './QueryModal';
2123
export default function FeatureTab(props: any) {
2224
//STATE DECLARATION (dbSpy3.0)
2325
const { setEdges, setNodes } = useFlowStore((state) => state);
26+
2427
const { schemaStore, setSchemaStore, undoHandler, redoHandler, historyCounter } = useSchemaStore((state) => state);
2528
const { user, setUser } = useCredentialsStore((state: any) => state);
29+
2630
const { setWelcome } = useSettingsStore((state) => state);
2731
const [action, setAction] = useState(new Array());
2832
const [queryModalOpened, setQueryModalOpened] = useState(false);
@@ -110,16 +114,6 @@ export default function FeatureTab(props: any) {
110114
setQueryModalOpened(false);
111115
};
112116

113-
114-
115-
// Undo/Redo functionality
116-
const undoClick = () => { // commented logic for undoing at history[0] because there's a button for clearing canvas anyway
117-
// if (historyCounter <= 1){
118-
// clearCanvasTables();
119-
// }
120-
undoHandler(); // from schemaStore
121-
}
122-
123117
// Temp
124118
const saveSchema = (): void => {
125119
// TODO: Sign in to upload/save
@@ -159,6 +153,16 @@ export default function FeatureTab(props: any) {
159153
setSchemaStore({});
160154
setUser(null);
161155
}
156+
157+
// Undo/Redo functionality
158+
const undoClick = () => { // commented logic for undoing at history[0] because there's a button for clearing canvas anyway
159+
// if (historyCounter <= 1){
160+
// clearCanvasTables();
161+
// }
162+
undoHandler(); // from schemaStore
163+
}
164+
165+
162166
// END: HELPER FUNCTIONS
163167

164168
return (

0 commit comments

Comments
 (0)