@@ -7,6 +7,9 @@ import { URLSearchParams } from 'url';
77import { generateCodeChallenge } from './code-challenge.service' ;
88import * as RandomString from 'randomstring' ;
99import fetch from 'node-fetch' ;
10+ import { accountViewDataProvider } from '../tree-view-providers/account-view-data-provider' ;
11+ import { postsDataProvider } from '../tree-view-providers/posts-data-provider' ;
12+ import { postCategoriesDataProvider } from '../tree-view-providers/categories-view-data-provider' ;
1013
1114const isAuthorizedStorageKey = 'isAuthorized' ;
1215
@@ -58,6 +61,9 @@ export class AccountService extends vscode.Disposable {
5861 ] ) ;
5962 url = `${ url } ?${ search } ` ;
6063 await vscode . commands . executeCommand ( 'vscode.open' , vscode . Uri . parse ( url ) ) ;
64+ accountViewDataProvider . fireTreeDataChangedEvent ( ) ;
65+ postsDataProvider . fireTreeDataChangedEvent ( undefined ) ;
66+ postCategoriesDataProvider . fireTreeDataChangedEvent ( ) ;
6167 }
6268
6369 async logout ( ) {
@@ -68,8 +74,8 @@ export class AccountService extends vscode.Disposable {
6874 const { clientId, revocationEndpoint, authority } = globalState . config . oauth ;
6975 const token = this . curUser ?. authorizationInfo ?. accessToken ;
7076
71- this . setIsAuthorized ( false ) ;
72- globalState . storage . update ( 'user' , { } ) ;
77+ await globalState . storage . update ( 'user' , { } ) ;
78+ await this . setIsAuthorized ( false ) ;
7379
7480 if ( token ) {
7581 const body = new URLSearchParams ( [
0 commit comments