Skip to content

Commit 74196a5

Browse files
authored
Fix the bug that extension could not auto sign in (#86)
1 parent af41a43 commit 74196a5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
77
### Added
88
- Add Code Lens for submitting the answer to LeetCode
99

10+
### Fixed
11+
- Fix the bug that the extension could not automatically sign in([72](https://github.com/jdneo/vscode-leetcode/issues/72))
12+
1013
## [0.8.1]
1114
### Changed
1215
- Upgrade LeetCode CLI to v2.6.1

src/extension.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
1919
if (!await leetCodeExecutor.meetRequirements()) {
2020
return;
2121
}
22+
23+
leetCodeManager.on("statusChanged", () => {
24+
leetCodeStatusBarItem.updateStatusBar(leetCodeManager.getStatus(), leetCodeManager.getUser());
25+
leetCodeTreeDataProvider.refresh();
26+
});
27+
2228
leetCodeManager.getLoginStatus();
2329
const leetCodeTreeDataProvider: LeetCodeTreeDataProvider = new LeetCodeTreeDataProvider(context);
2430

@@ -41,11 +47,6 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
4147
);
4248

4349
await plugin.initializeEndpoint();
44-
45-
leetCodeManager.on("statusChanged", () => {
46-
leetCodeStatusBarItem.updateStatusBar(leetCodeManager.getStatus(), leetCodeManager.getUser());
47-
leetCodeTreeDataProvider.refresh();
48-
});
4950
}
5051

5152
export function deactivate(): void {

0 commit comments

Comments
 (0)