@@ -7,6 +7,9 @@ import { URLSearchParams } from 'url';
7
7
import { generateCodeChallenge } from './code-challenge.service' ;
8
8
import * as RandomString from 'randomstring' ;
9
9
import 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' ;
10
13
11
14
const isAuthorizedStorageKey = 'isAuthorized' ;
12
15
@@ -58,6 +61,9 @@ export class AccountService extends vscode.Disposable {
58
61
] ) ;
59
62
url = `${ url } ?${ search } ` ;
60
63
await vscode . commands . executeCommand ( 'vscode.open' , vscode . Uri . parse ( url ) ) ;
64
+ accountViewDataProvider . fireTreeDataChangedEvent ( ) ;
65
+ postsDataProvider . fireTreeDataChangedEvent ( undefined ) ;
66
+ postCategoriesDataProvider . fireTreeDataChangedEvent ( ) ;
61
67
}
62
68
63
69
async logout ( ) {
@@ -68,8 +74,8 @@ export class AccountService extends vscode.Disposable {
68
74
const { clientId, revocationEndpoint, authority } = globalState . config . oauth ;
69
75
const token = this . curUser ?. authorizationInfo ?. accessToken ;
70
76
71
- this . setIsAuthorized ( false ) ;
72
- globalState . storage . update ( 'user' , { } ) ;
77
+ await globalState . storage . update ( 'user' , { } ) ;
78
+ await this . setIsAuthorized ( false ) ;
73
79
74
80
if ( token ) {
75
81
const body = new URLSearchParams ( [
0 commit comments