From e51f15dbeae4762c6f2687b04a64c03ee3af653c Mon Sep 17 00:00:00 2001 From: "Maxence G. de Montauzan" Date: Mon, 8 Aug 2022 15:16:12 +0200 Subject: [PATCH 1/2] Fix #26 - 'Element with id XX is already registered' Change init page number --- src/issueProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/issueProvider.ts b/src/issueProvider.ts index e92a4b3..92a6d2e 100644 --- a/src/issueProvider.ts +++ b/src/issueProvider.ts @@ -26,7 +26,7 @@ export class IssueProvider implements vscode.TreeDataProvider { const giteaConnector = new GiteaConnector(config.token, config.sslVerify); const issues = []; - let page = 0; + let page = 1; while (page < 11) { const issuesOfPage = (await giteaConnector.getIssues(config.repoApiUrl, this.state, page)).data; issues.push(...issuesOfPage); From c901eeb81638b446e588c9bc7c51a74798e65f15 Mon Sep 17 00:00:00 2001 From: "Maxence G. de Montauzan" Date: Mon, 8 Aug 2022 15:49:27 +0200 Subject: [PATCH 2/2] Fix: stop retrieve issues when there are none left --- src/issueProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/issueProvider.ts b/src/issueProvider.ts index 92a6d2e..dc3637a 100644 --- a/src/issueProvider.ts +++ b/src/issueProvider.ts @@ -37,7 +37,7 @@ export class IssueProvider implements vscode.TreeDataProvider { c.creator = c.user.login; }); page++; - if (issues.length < 10) { + if (issuesOfPage.length < 10) { break; } }