diff --git a/CHANGELOG.md b/CHANGELOG.md index 53381d14..4799ad85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ### Added - Add Code Lens for submitting the answer to LeetCode +### Fixed +- Fix the bug that the extension could not automatically sign in([72](https://github.com/jdneo/vscode-leetcode/issues/72)) + ## [0.8.1] ### Changed - Upgrade LeetCode CLI to v2.6.1 diff --git a/src/extension.ts b/src/extension.ts index 26e29567..240cadae 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -19,6 +19,12 @@ export async function activate(context: vscode.ExtensionContext): Promise if (!await leetCodeExecutor.meetRequirements()) { return; } + + leetCodeManager.on("statusChanged", () => { + leetCodeStatusBarItem.updateStatusBar(leetCodeManager.getStatus(), leetCodeManager.getUser()); + leetCodeTreeDataProvider.refresh(); + }); + leetCodeManager.getLoginStatus(); const leetCodeTreeDataProvider: LeetCodeTreeDataProvider = new LeetCodeTreeDataProvider(context); @@ -41,11 +47,6 @@ export async function activate(context: vscode.ExtensionContext): Promise ); await plugin.initializeEndpoint(); - - leetCodeManager.on("statusChanged", () => { - leetCodeStatusBarItem.updateStatusBar(leetCodeManager.getStatus(), leetCodeManager.getUser()); - leetCodeTreeDataProvider.refresh(); - }); } export function deactivate(): void {