Skip to content

Commit f135688

Browse files
committed
fix(qupta-view): Add intermediate message while loading
1 parent 93e2420 commit f135688

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@
8585
{
8686
"type": "webview",
8787
"id": "gitguardianQuotaView",
88-
"name": "quota"
88+
"name": "quota",
89+
"collapsed": true
8990
}
9091
]
9192
},

src/ggshield-webview/gitguardian-quota-webview.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)