Skip to content

Commit

Permalink
fix: remove duplicates from library list (if current library is also …
Browse files Browse the repository at this point in the history
…in library list)
  • Loading branch information
janfh committed Jan 14, 2025
1 parent f8b99fe commit be01154
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/connection/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class SQLJobManager {
const config = instance.getConfig();

const newJob = predefinedJob || (new OldSQLJob({
libraries: [config.currentLibrary, ...config.libraryList],
libraries: uniqueStrings([config.currentLibrary, ...config.libraryList]),
naming: `system`,
"full open": false,
"transaction isolation": "none",
Expand Down Expand Up @@ -161,4 +161,10 @@ export class SQLJobManager {
static getSelfDefault(): SelfValue {
return Configuration.get<SelfValue>(`jobSelfDefault`) || `*NONE`;
}
}
}

const uniqueStrings = (arr: string[]): string[] => {
return arr.filter((item,
index) => arr.indexOf(item) === index);
}

0 comments on commit be01154

Please sign in to comment.