Skip to content

Commit f07f249

Browse files
authored
Merge pull request #12 from GitGuardian/salomevoltz/hide-quota-view-when-unauthenticated
fix(quota-webview): Hide view when unauthenticated
2 parents 070df30 + 2754c9f commit f07f249

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
"type": "webview",
8787
"id": "gitguardianQuotaView",
8888
"name": "quota",
89-
"collapsed": true
89+
"collapsed": true,
90+
"when": "isAuthenticated == true"
9091
}
9192
]
9293
},

src/extension.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ export function activate(context: ExtensionContext) {
163163
authStatus = ggshieldAuthStatus(configuration);
164164
if (!authStatus) {
165165
updateStatusBarItem(StatusBarStatus.unauthenticated, statusBar);
166-
}
166+
} else {
167+
commands.executeCommand('setContext', 'isAuthenticated', true);
168+
}
167169
})
168170
.then(async () => {
169171
// Check if git is installed
@@ -230,6 +232,7 @@ export function activate(context: ExtensionContext) {
230232
if (isAuthenticated) {
231233
authStatus = true;
232234
updateStatusBarItem(StatusBarStatus.ready, statusBar);
235+
commands.executeCommand('setContext', 'isAuthenticated', true);
233236
ggshieldViewProvider.refresh();
234237
ggshieldQuotaViewProvider.refresh();
235238
} else {

0 commit comments

Comments
 (0)