Pārlūkot izejas kodu

Ensures reset command only works when debugging

main
Eric Amodio pirms 2 gadiem
vecāks
revīzija
15ab1aca5a
4 mainītis faili ar 13 papildinājumiem un 5 dzēšanām
  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 Parādīt failu

@ -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 Parādīt failu

@ -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 Parādīt failu

@ -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 Parādīt failu

@ -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({

Notiek ielāde…
Atcelt
Saglabāt