File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,13 @@ module.exports = class schemaBrowser {
46
46
vscode . commands . registerCommand ( `vscode-db2i.addSchemaToSchemaBrowser` , async ( ) => {
47
47
const config = instance . getConfig ( ) ;
48
48
49
- let schemas = config . databaseBrowserList ;
49
+ const schemas = config . databaseBrowserList || [ ] ;
50
50
51
51
const newSchema = await vscode . window . showInputBox ( {
52
52
prompt : `Library to add to Database Browser`
53
53
} ) ;
54
54
55
- if ( newSchema ) {
55
+ if ( newSchema && ! schemas . includes ( newSchema . toUpperCase ( ) ) ) {
56
56
schemas . push ( newSchema . toUpperCase ( ) ) ;
57
57
await config . set ( `databaseBrowserList` , schemas ) ;
58
58
this . refresh ( ) ;
@@ -221,7 +221,7 @@ module.exports = class schemaBrowser {
221
221
if ( connection ) {
222
222
const config = instance . getConfig ( ) ;
223
223
224
- const libraries = config . databaseBrowserList ;
224
+ const libraries = config . databaseBrowserList || [ ] ;
225
225
226
226
for ( let library of libraries ) {
227
227
items . push ( new Schema ( library ) ) ;
You can’t perform that action at this time.
0 commit comments