Skip to content

Commit

Permalink
Fix the bug that extension could not auto sign in (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Jan 6, 2019
1 parent af41a43 commit 74196a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
if (!await leetCodeExecutor.meetRequirements()) {
return;
}

leetCodeManager.on("statusChanged", () => {
leetCodeStatusBarItem.updateStatusBar(leetCodeManager.getStatus(), leetCodeManager.getUser());
leetCodeTreeDataProvider.refresh();
});

leetCodeManager.getLoginStatus();
const leetCodeTreeDataProvider: LeetCodeTreeDataProvider = new LeetCodeTreeDataProvider(context);

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

await plugin.initializeEndpoint();

leetCodeManager.on("statusChanged", () => {
leetCodeStatusBarItem.updateStatusBar(leetCodeManager.getStatus(), leetCodeManager.getUser());
leetCodeTreeDataProvider.refresh();
});
}

export function deactivate(): void {
Expand Down

0 comments on commit 74196a5

Please sign in to comment.