Selaa lähdekoodia

Ensures reset command only works when debugging

main
Eric Amodio 2 vuotta sitten
vanhempi
commit
15ab1aca5a
4 muutettua tiedostoa jossa 13 lisäystä ja 5 poistoa
  1. +2
    -1
      package.json
  2. +1
    -0
      src/constants.ts
  3. +5
    -0
      src/extension.ts
  4. +5
    -4
      src/premium/subscription/subscriptionService.ts

+ 2
- 1
package.json Näytä tiedosto

@ -5934,7 +5934,8 @@
"when": "!gitlens:premium:paid"
},
{
"command": "gitlens.premium.reset"
"command": "gitlens.premium.reset",
"when": "gitlens:debugging"
},
{
"command": "gitlens.showSettingsPage#views",

+ 1
- 0
src/constants.ts Näytä tiedosto

@ -233,6 +233,7 @@ export const enum ContextKeys {
ActiveFileStatus = 'gitlens:activeFileStatus',
AnnotationStatus = 'gitlens:annotationStatus',
Debugging = 'gitlens:debugging',
DisabledToggleCodeLens = 'gitlens:disabledToggleCodeLens',
Disabled = 'gitlens:disabled',
Enabled = 'gitlens:enabled',

+ 5
- 0
src/extension.ts Näytä tiedosto

@ -128,6 +128,11 @@ export async function activate(context: ExtensionContext): Promise
// Signal that the container is now ready
await container.ready();
// Set a context to only show some commands when debugging
if (container.debugging) {
void setContext(ContextKeys.Debugging, true);
}
sw.stop({
message: ` activated${exitMessage != null ? `, ${exitMessage}` : ''}${
cfg.mode.active ? `, mode: ${cfg.mode.active}` : ''

+ 5
- 4
src/premium/subscription/subscriptionService.ts Näytä tiedosto

@ -165,13 +165,13 @@ export class SubscriptionService implements Disposable {
commands.registerCommand(Commands.PremiumStartPreviewTrial, () => this.startPreviewTrial()),
commands.registerCommand(Commands.PremiumPurchase, () => this.purchase()),
// TODO@eamodio remove before release
commands.registerCommand('gitlens.premium.reset', () => this.logout(true)),
commands.registerCommand(Commands.PremiumResendVerification, () => this.resendVerification()),
commands.registerCommand(Commands.PremiumValidate, () => this.validate()),
commands.registerCommand(Commands.PremiumShowPlans, () => this.showPlans()),
commands.registerCommand('gitlens.premium.reset', () => this.logout(true)),
];
}
@ -237,9 +237,10 @@ export class SubscriptionService implements Disposable {
this._session = undefined;
void this.container.storage.storeWorkspace(this.connectedKey, false);
// TODO@eamodio remove this before release
if (reset && this.container.env === 'dev') {
if (reset && this.container.debugging) {
this.changeSubscription(undefined);
return;
}
this.changeSubscription({

Ladataan…
Peruuta
Tallenna