File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 8585 {
8686 "type" : " webview" ,
8787 "id" : " gitguardianQuotaView" ,
88- "name" : " quota"
88+ "name" : " quota" ,
89+ "collapsed" : true
8990 }
9091 ]
9192 },
Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ export class GitGuardianQuotaWebviewProvider
99 private _view ?: vscode . WebviewView ;
1010 private isAuthenticated : boolean = false ;
1111 private quota : number = 0 ;
12+ private isLoading : boolean = false ;
1213
1314 constructor (
1415 private ggshieldConfiguration : GGShieldConfiguration ,
1516 private readonly _extensionUri : vscode . Uri
1617 ) {
1718 this . checkAuthenticationStatus ( ) ;
19+ this . updateQuota ( ) ;
1820 }
1921
2022 public async resolveWebviewView (
@@ -71,6 +73,16 @@ export class GitGuardianQuotaWebviewProvider
7173
7274 this . updateQuota ( ) ;
7375
76+ if ( this . isLoading ) {
77+ return `
78+ <!DOCTYPE html>
79+ <html lang="en">
80+ <body>
81+ <p>Loading...</p>
82+ </body>
83+ </html>` ;
84+ }
85+
7486 if ( this . isAuthenticated ) {
7587 return `
7688 <!DOCTYPE html>
@@ -91,9 +103,13 @@ export class GitGuardianQuotaWebviewProvider
91103 }
92104
93105 public async refresh ( ) {
106+ this . isLoading = true ;
107+ this . updateWebViewContent ( this . _view ) ;
108+
94109 await this . checkAuthenticationStatus ( ) ;
95110 await this . updateQuota ( ) ;
96111
112+ this . isLoading = false ;
97113 this . updateWebViewContent ( this . _view ) ;
98114 }
99115
You can’t perform that action at this time.
0 commit comments