Skip to content

Commit 3ad7273

Browse files
GeekMasherCopilot
andauthored
Update src/providers/uiProvider.ts
Co-authored-by: Copilot <[email protected]>
1 parent 2473d3f commit 3ad7273

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/providers/uiProvider.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,16 @@ export class UiProvider implements vscode.WebviewViewProvider {
121121
if (config.githubUrl) {
122122
let apiUrl = "https://api.github.com";
123123

124-
if (config.githubUrl) {
125-
if (config.githubUrl === "github.com" || config.githubUrl === "https://github.com") {
126-
apiUrl = "https://api.github.com";
127-
} else {
128-
// Remove https:// prefix if present
129-
const cleanUrl = config.githubUrl.replace(/^https?:\/\//, '');
130-
131-
// For GitHub Enterprise, convert to API URL format
132-
apiUrl = `https://${cleanUrl}`;
133-
if (!apiUrl.includes('/api/v3')) {
134-
apiUrl = apiUrl.endsWith('/') ? `${apiUrl}api/v3` : `${apiUrl}/api/v3`;
135-
}
124+
if (config.githubUrl === "github.com" || config.githubUrl === "https://github.com") {
125+
apiUrl = "https://api.github.com";
126+
} else {
127+
// Remove https:// prefix if present
128+
const cleanUrl = config.githubUrl.replace(/^https?:\/\//, '');
129+
130+
// For GitHub Enterprise, convert to API URL format
131+
apiUrl = `https://${cleanUrl}`;
132+
if (!apiUrl.includes('/api/v3')) {
133+
apiUrl = apiUrl.endsWith('/') ? `${apiUrl}api/v3` : `${apiUrl}/api/v3`;
136134
}
137135
}
138136

0 commit comments

Comments
 (0)