Skip to content

Commit be01154

Browse files
committed
fix: remove duplicates from library list (if current library is also in library list)
1 parent f8b99fe commit be01154

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/connection/manager.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class SQLJobManager {
3030
const config = instance.getConfig();
3131

3232
const newJob = predefinedJob || (new OldSQLJob({
33-
libraries: [config.currentLibrary, ...config.libraryList],
33+
libraries: uniqueStrings([config.currentLibrary, ...config.libraryList]),
3434
naming: `system`,
3535
"full open": false,
3636
"transaction isolation": "none",
@@ -161,4 +161,10 @@ export class SQLJobManager {
161161
static getSelfDefault(): SelfValue {
162162
return Configuration.get<SelfValue>(`jobSelfDefault`) || `*NONE`;
163163
}
164-
}
164+
}
165+
166+
const uniqueStrings = (arr: string[]): string[] => {
167+
return arr.filter((item,
168+
index) => arr.indexOf(item) === index);
169+
}
170+

0 commit comments

Comments
 (0)