Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5c8e7f

Browse files
committed
Fix LGTM warning
1 parent825ca17 commitf5c8e7f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎src/webview/leetCodePreviewProvider.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Licensed under the MIT license.
33

44
import{commands,ViewColumn}from"vscode";
5-
import{IProblem}from"../shared";
5+
import{getLeetCodeEndpoint}from"../commands/plugin";
6+
import{Endpoint,IProblem}from"../shared";
67
import{ILeetCodeWebviewOption,LeetCodeWebview}from"./LeetCodeWebview";
78
import{markdownEngine}from"./markdownEngine";
89

@@ -180,21 +181,18 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
180181
}
181182

182183
privategetDiscussionLink(url:string):string{
183-
if(url.includes("leetcode-cn.com")){
184+
constendPoint:string=getLeetCodeEndpoint();
185+
if(endPoint===Endpoint.LeetCodeCN){
184186
returnurl.replace("/description/","/comments/");
185-
}elseif(url.includes("leetcode.com")){
187+
}elseif(endPoint===Endpoint.LeetCode){
186188
returnurl.replace("/description/","/discuss/?currentPage=1&orderBy=most_votes&query=");
187189
}
188190

189191
return"https://leetcode.com";
190192
}
191193

192194
privategetSolutionLink(url:string):string{
193-
if(url.includes("leetcode-cn.com")||url.includes("leetcode.com")){
194-
returnurl.replace("/description/","/solution/");
195-
}
196-
197-
return"https://leetcode.com";
195+
returnurl.replace("/description/","/solution/");
198196
}
199197
}
200198

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp