diff --git a/.vscodeignore b/.vscodeignore index e66d0b8..9eed04a 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -8,4 +8,5 @@ vsc-extension-quickstart.md **/tsconfig.json **/.eslintrc.json **/*.map -**/*.ts \ No newline at end of file +**/*.ts +dist/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 07a5589..bcb8c46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 1.2.3 - 2023-03-14 + +- Fixed a bug in server items editing. + ## 1.2.1 - 2023-03-12 - Server items editing improved. diff --git a/package.json b/package.json index 1395853..540d5e6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "drone-ci", "displayName": "Drone CI", "description": "Manage your Drone CI servers easily", - "version": "1.2.1", + "version": "1.2.3", "publisher": "maximtrp", "author": { "name": "Maksim Terpilovskii", diff --git a/src/servers.ts b/src/servers.ts index 2bd6e6c..b968678 100644 --- a/src/servers.ts +++ b/src/servers.ts @@ -91,17 +91,15 @@ export class ServersProvider implements vscode.TreeDataProvider { return; } else { // Getting existing servers - servers = JSON.parse((await this.context.secrets.get("servers")) || "[]"); + servers = JSON.parse((await this.context.secrets.get("servers")) || "[]").filter( + (existingServer: ServerInfo) => server.url !== existingServer.url + ); // Checking if a server with entered URL exists - let serverExists = servers - .filter((existingServer: ServerInfo) => server.url !== existingServer.url) - .find((server: ServerInfo) => server.url === url); + let serverExists = servers.find((server: ServerInfo) => server.url === url); if (serverExists) { vscode.window.showErrorMessage("Server with this URL already exists"); return; } - // Removing the server that is being editted - servers = servers.filter((server: ServerInfo) => server.url !== url); } const label = await vscode.window.showInputBox({