1
1
// React & React Router & React Query Modules
2
+
2
3
import React , { useState , useRef , useEffect } from 'react' ;
3
4
import axios from 'axios' ;
4
5
6
+
5
7
// Functions imported:
6
8
import parseSql from '../../parse' ;
7
9
import createEdges from '../ReactFlow/createEdges' ;
@@ -21,8 +23,10 @@ import QueryModal from './QueryModal';
21
23
export default function FeatureTab ( props : any ) {
22
24
//STATE DECLARATION (dbSpy3.0)
23
25
const { setEdges, setNodes } = useFlowStore ( ( state ) => state ) ;
26
+
24
27
const { schemaStore, setSchemaStore, undoHandler, redoHandler, historyCounter } = useSchemaStore ( ( state ) => state ) ;
25
28
const { user, setUser } = useCredentialsStore ( ( state : any ) => state ) ;
29
+
26
30
const { setWelcome } = useSettingsStore ( ( state ) => state ) ;
27
31
const [ action , setAction ] = useState ( new Array ( ) ) ;
28
32
const [ queryModalOpened , setQueryModalOpened ] = useState ( false ) ;
@@ -110,16 +114,6 @@ export default function FeatureTab(props: any) {
110
114
setQueryModalOpened ( false ) ;
111
115
} ;
112
116
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
-
123
117
// Temp
124
118
const saveSchema = ( ) : void => {
125
119
// TODO: Sign in to upload/save
@@ -159,6 +153,16 @@ export default function FeatureTab(props: any) {
159
153
setSchemaStore ( { } ) ;
160
154
setUser ( null ) ;
161
155
}
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
+
162
166
// END: HELPER FUNCTIONS
163
167
164
168
return (
0 commit comments