File tree Expand file tree Collapse file tree
chat2db-client/src/components/Console Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,9 +173,12 @@ function Console(props: IProps, ref: ForwardedRef<IConsoleRef>) {
173173 } ;
174174 } , [ isActive ] ) ;
175175
176- function timingAutoSave ( ) {
176+ function timingAutoSave ( status ?: ConsoleStatus ) {
177+ if ( timerRef . current ) {
178+ clearInterval ( timerRef . current ) ;
179+ }
177180 timerRef . current = setInterval ( ( ) => {
178- if ( executeParams . status === ConsoleStatus . RELEASE ) {
181+ if ( executeParams . status === ConsoleStatus . RELEASE || status === ConsoleStatus . RELEASE ) {
179182 const p : any = {
180183 id : executeParams . consoleId ,
181184 ddl : editorRef ?. current ?. getAllContent ( ) ,
@@ -188,7 +191,7 @@ function Console(props: IProps, ref: ForwardedRef<IConsoleRef>) {
188191 userId : getCookie ( 'CHAT2DB.USER_ID' ) ,
189192 } ) ;
190193 }
191- } , 2000 ) ;
194+ } , 5000 ) ;
192195 }
193196
194197 const tableListName = useMemo ( ( ) => {
@@ -388,6 +391,7 @@ function Console(props: IProps, ref: ForwardedRef<IConsoleRef>) {
388391 indexedDB . deleteData ( 'chat2db' , 'workspaceConsoleDDL' , executeParams . consoleId ! ) ;
389392 message . success ( i18n ( 'common.tips.saveSuccessfully' ) ) ;
390393 props . onConsoleSave && props . onConsoleSave ( ) ;
394+ timingAutoSave ( ConsoleStatus . RELEASE ) ;
391395 } ) ;
392396 } ;
393397
You can’t perform that action at this time.
0 commit comments