From b01b703cb762422fb82c7dd0a8416c85a450c110 Mon Sep 17 00:00:00 2001 From: Sergio Date: Tue, 5 Nov 2024 16:54:33 +0100 Subject: [PATCH] undo commented out blocks --- src/commands/quickCommand.steps.ts | 6 +++--- src/commands/quickWizard.base.ts | 3 +-- src/constants.commands.ts | 1 - src/plus/utils.ts | 7 +++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/commands/quickCommand.steps.ts b/src/commands/quickCommand.steps.ts index 6ef01d074a1a0..72729c473ebfc 100644 --- a/src/commands/quickCommand.steps.ts +++ b/src/commands/quickCommand.steps.ts @@ -44,7 +44,7 @@ import type { GitWorktree, WorktreeQuickPickItem } from '../git/models/worktree' import { createWorktreeQuickPickItem, getWorktreesByBranch, sortWorktrees } from '../git/models/worktree'; import { remoteUrlRegex } from '../git/parsers/remoteParser'; import { getApplicablePromo } from '../plus/gk/account/promos'; -import { isSubscriptionPaidPlan } from '../plus/gk/account/subscription'; +import { isSubscriptionPaidPlan, isSubscriptionPreviewTrialExpired } from '../plus/gk/account/subscription'; import type { LaunchpadCommandArgs } from '../plus/launchpad/launchpad'; import { CommitApplyFileChangesCommandQuickPickItem, @@ -2645,7 +2645,7 @@ export async function* ensureAccessStep< createQuickPickSeparator(), createDirectiveQuickPickItem(Directive.Cancel), ); - } /*else if ( + } else if ( access.subscription.current.account == null && !isSubscriptionPreviewTrialExpired(access.subscription.current) ) { @@ -2654,7 +2654,7 @@ export async function* ensureAccessStep< createQuickPickSeparator(), createDirectiveQuickPickItem(Directive.Cancel), ); - }*/ else { + } else { directives.push( createDirectiveQuickPickItem(Directive.StartProTrial, true), createDirectiveQuickPickItem(Directive.SignIn), diff --git a/src/commands/quickWizard.base.ts b/src/commands/quickWizard.base.ts index 392faba0f9fe9..c0fbbe2ced9a4 100644 --- a/src/commands/quickWizard.base.ts +++ b/src/commands/quickWizard.base.ts @@ -704,7 +704,6 @@ export abstract class QuickWizardCommandBase extends Command { return; } - /* case Directive.StartPreview: await Container.instance.subscription.startPreviewTrial({ source: 'quick-wizard', @@ -715,7 +714,7 @@ export abstract class QuickWizardCommandBase extends Command { }); resolve(await rootStep.command?.retry()); return; - */ + case Directive.RequiresVerification: { const result = await Container.instance.subscription.resendVerification({ source: 'quick-wizard', diff --git a/src/constants.commands.ts b/src/constants.commands.ts index 1b34bf4229538..c079c984388ec 100644 --- a/src/constants.commands.ts +++ b/src/constants.commands.ts @@ -149,7 +149,6 @@ export const enum Commands { PlusShowPlans = 'gitlens.plus.showPlans', PlusSignUp = 'gitlens.plus.signUp', PlusStartPreviewTrial = 'gitlens.plus.startPreviewTrial', - PlusStartFeaturePreviewTrial = 'gitlens.plus.startFeaturePreviewTrial', PlusUpgrade = 'gitlens.plus.upgrade', PlusValidate = 'gitlens.plus.validate', PlusSimulateSubscription = 'gitlens.plus.simulateSubscription', diff --git a/src/plus/utils.ts b/src/plus/utils.ts index 7989fd1519d6d..ed9fa9a7ba539 100644 --- a/src/plus/utils.ts +++ b/src/plus/utils.ts @@ -11,7 +11,7 @@ export async function ensurePaidPlan( container: Container, title: string, source: Source, - _?: { allowPreview?: boolean }, + options?: { allowPreview?: boolean }, ): Promise { while (true) { const subscription = await container.subscription.getSubscription(); @@ -37,7 +37,7 @@ export async function ensurePaidPlan( const plan = subscription.plan.effective.id; if (isSubscriptionPaidPlan(plan)) break; - /*if (options?.allowPreview && subscription.account == null && !isSubscriptionPreviewTrialExpired(subscription)) { + if (options?.allowPreview && subscription.account == null && !isSubscriptionPreviewTrialExpired(subscription)) { const startTrial = { title: 'Continue' }; const cancel = { title: 'Cancel', isCloseAffordance: true }; const result = await window.showWarningMessage( @@ -51,8 +51,7 @@ export async function ensurePaidPlan( void container.subscription.startPreviewTrial(source); break; - } else */ - if (subscription.account == null) { + } else if (subscription.account == null) { const signUp = { title: 'Start Pro Trial' }; const signIn = { title: 'Sign In' }; const cancel = { title: 'Cancel', isCloseAffordance: true };