Skip to content

Commit

Permalink
Merge pull request #12 from GitGuardian/salomevoltz/hide-quota-view-w…
Browse files Browse the repository at this point in the history
…hen-unauthenticated

fix(quota-webview): Hide view when unauthenticated
  • Loading branch information
fnareoh committed Sep 23, 2024
2 parents 070df30 + 2754c9f commit f07f249
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"type": "webview",
"id": "gitguardianQuotaView",
"name": "quota",
"collapsed": true
"collapsed": true,
"when": "isAuthenticated == true"
}
]
},
Expand Down
5 changes: 4 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ export function activate(context: ExtensionContext) {
authStatus = ggshieldAuthStatus(configuration);
if (!authStatus) {
updateStatusBarItem(StatusBarStatus.unauthenticated, statusBar);
}
} else {
commands.executeCommand('setContext', 'isAuthenticated', true);
}
})
.then(async () => {
// Check if git is installed
Expand Down Expand Up @@ -230,6 +232,7 @@ export function activate(context: ExtensionContext) {
if (isAuthenticated) {
authStatus = true;
updateStatusBarItem(StatusBarStatus.ready, statusBar);
commands.executeCommand('setContext', 'isAuthenticated', true);
ggshieldViewProvider.refresh();
ggshieldQuotaViewProvider.refresh();
} else {
Expand Down

0 comments on commit f07f249

Please sign in to comment.