@@ -190,12 +190,14 @@ const SelectBoundInfo = memo((props: IProps) => {
190190 databaseName : void 0 ,
191191 schemaName : void 0 ,
192192 } ) ;
193- historyService . updateSavedConsole ( {
194- id : boundInfo . consoleId ,
195- dataSourceId : currentData . value ,
196- dataSourceName : currentData . label ,
197- type : currentData . type ,
198- } ) ;
193+ if ( boundInfo . consoleId ) {
194+ historyService . updateSavedConsole ( {
195+ id : boundInfo . consoleId ,
196+ dataSourceId : currentData . value ,
197+ dataSourceName : currentData . label ,
198+ type : currentData . type ,
199+ } ) ;
200+ }
199201 } ;
200202
201203 // 选择数据库
@@ -208,10 +210,12 @@ const SelectBoundInfo = memo((props: IProps) => {
208210 schemaName : void 0 ,
209211 } ) ;
210212
211- historyService . updateSavedConsole ( {
212- id : boundInfo . consoleId ,
213- databaseName : _databaseName ,
214- } ) ;
213+ if ( boundInfo . consoleId ) {
214+ historyService . updateSavedConsole ( {
215+ id : boundInfo . consoleId ,
216+ databaseName : _databaseName ,
217+ } ) ;
218+ }
215219 } ;
216220
217221 // 选择schema
@@ -222,10 +226,12 @@ const SelectBoundInfo = memo((props: IProps) => {
222226 schemaName : _schemaName ,
223227 } ) ;
224228
225- historyService . updateSavedConsole ( {
226- id : boundInfo . consoleId ,
227- schemaName : _schemaName ,
228- } ) ;
229+ if ( boundInfo . consoleId ) {
230+ historyService . updateSavedConsole ( {
231+ id : boundInfo . consoleId ,
232+ schemaName : _schemaName ,
233+ } ) ;
234+ }
229235 } ;
230236
231237 const getAllTableNameList = ( dataSourceId , databaseName , schemaName ?) => {
0 commit comments