@@ -79,6 +79,11 @@ class EntitlementsContribution extends Disposable implements IWorkbenchContribut
79
79
80
80
private registerListeners ( ) {
81
81
82
+ if ( this . storageService . getBoolean ( accountsBadgeConfigKey , StorageScope . APPLICATION ) === false ) {
83
+ // we have already shown the entitlements. Do not show again
84
+ return ;
85
+ }
86
+
82
87
this . _register ( this . extensionService . onDidChangeExtensions ( async ( result ) => {
83
88
for ( const ext of result . added ) {
84
89
if ( ExtensionIdentifier . equals ( this . productService . gitHubEntitlement ! . extensionId , ext . identifier ) ) {
@@ -178,7 +183,15 @@ class EntitlementsContribution extends Disposable implements IWorkbenchContribut
178
183
const menuTitle = org ? this . productService . gitHubEntitlement ! . command . title . replace ( '{{org}}' , org ) : this . productService . gitHubEntitlement ! . command . titleWithoutPlaceHolder ;
179
184
180
185
const badge = new NumberBadge ( 1 , ( ) => menuTitle ) ;
181
- this . accountsMenuBadgeDisposable . value = this . activityService . showAccountsActivity ( { badge, } ) ;
186
+ this . accountsMenuBadgeDisposable . value = this . activityService . showAccountsActivity ( { badge } ) ;
187
+
188
+ this . contextService . onDidChangeContext ( e => {
189
+ if ( e . affectsSome ( new Set ( [ accountsBadgeConfigKey ] ) ) ) {
190
+ if ( ! this . contextService . getContextKeyValue < boolean > ( accountsBadgeConfigKey ) ) {
191
+ this . accountsMenuBadgeDisposable . clear ( ) ;
192
+ }
193
+ }
194
+ } ) ;
182
195
183
196
this . _register ( registerAction2 ( class extends Action2 {
184
197
constructor ( ) {
@@ -221,7 +234,7 @@ class EntitlementsContribution extends Disposable implements IWorkbenchContribut
221
234
} ) ;
222
235
}
223
236
224
- const contextKey = new RawContextKey < boolean > ( accountsBadgeConfigKey , true ) . bindTo ( contextKeyService ) ;
237
+ const contextKey = new RawContextKey < boolean > ( accountsBadgeConfigKey , false ) . bindTo ( contextKeyService ) ;
225
238
contextKey . set ( false ) ;
226
239
storageService . store ( accountsBadgeConfigKey , false , StorageScope . APPLICATION , StorageTarget . MACHINE ) ;
227
240
}
0 commit comments