Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8d24d57

Browse files
committed
rename cookie in to Sign in (by cookie)
1 parent 6ab8a3b commit 8d24d57

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
- You can also use the following command to sign in/cookie in/out:
4444
- **LeetCode: Sign in**
45-
- **LeetCode: Cookie in**
45+
- **LeetCode: Sign in (by cookie)**
4646
- **LeetCode: Sign out**
4747

4848
---

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
"onCommand:leetcode.testSolution",
3939
"onCommand:leetcode.submitSolution",
4040
"onCommand:leetcode.switchDefaultLanguage",
41-
"onCommand:leetcode.cookieIn",
41+
"onCommand:leetcode.signinByCookie",
4242
"onView:leetCodeExplorer"
4343
],
4444
"main": "./out/src/extension",
4545
"contributes": {
4646
"commands": [
4747
{
48-
"command": "leetcode.cookieIn",
49-
"title": "Cookie In",
48+
"command": "leetcode.signinByCookie",
49+
"title": "Sign In By Cookie",
5050
"category": "LeetCode"
5151
},
5252
{

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
5151
vscode.commands.registerCommand("leetcode.deleteCache", () => cache.deleteCache()),
5252
vscode.commands.registerCommand("leetcode.toggleLeetCodeCn", () => plugin.switchEndpoint()),
5353
vscode.commands.registerCommand("leetcode.signin", () => leetCodeManager.signIn()),
54-
vscode.commands.registerCommand("leetcode.cookieIn", () => leetCodeManager.signIn(true)),
54+
vscode.commands.registerCommand("leetcode.signinByCookie", () => leetCodeManager.signIn(true)),
5555
vscode.commands.registerCommand("leetcode.signout", () => leetCodeManager.signOut()),
5656
vscode.commands.registerCommand("leetcode.manageSessions", () => session.manageSessions()),
5757
vscode.commands.registerCommand("leetcode.previewProblem", (node: LeetCodeNode) => show.previewProblem(node)),

src/leetCodeManager.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ class LeetCodeManager extends EventEmitter {
3434
}
3535
}
3636

37-
public async signIn(isCookieIn: boolean = false): Promise<void> {
37+
public async signIn(isByCookie: boolean = false): Promise<void> {
3838
const loginArg: string = "-l";
39-
const cookieInArg: string = "-c";
40-
const commandArg: string = isCookieIn ? cookieInArg : loginArg;
41-
const inMessage: string = isCookieIn ? "cookie in" : "sign in";
39+
const cookieArg: string = "-c";
40+
const commandArg: string = isByCookie ? cookieArg : loginArg;
41+
const inMessage: string = isByCookie ? "sign in by cookie" : "sign in";
4242
try {
4343
const userName: string | undefined = await new Promise(async (resolve: (res: string | undefined) => void, reject: (e: Error) => void): Promise<void> => {
4444
let result: string = "";
@@ -71,9 +71,9 @@ class LeetCodeManager extends EventEmitter {
7171
}
7272
childProc.stdin.write(`${name}\n`);
7373
const pwd: string | undefined = await vscode.window.showInputBox({
74-
prompt: isCookieIn ? "Enter cookie" : "Enter password.",
74+
prompt: isByCookie ? "Enter cookie" : "Enter password.",
7575
password: true,
76-
validateInput: (s: string): string | undefined => s ? undefined : isCookieIn ? "Cookie must not be empty" : "Password must not be empty",
76+
validateInput: (s: string): string | undefined => s ? undefined : isByCookie ? "Cookie must not be empty" : "Password must not be empty",
7777
});
7878
if (!pwd) {
7979
childProc.kill();

0 commit comments

Comments
 (0)