Skip to content

Commit

Permalink
undo commented out blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiolms committed Nov 5, 2024
1 parent 6fc77d0 commit c3bd4d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/commands/quickCommand.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
) {
Expand All @@ -2654,7 +2654,7 @@ export async function* ensureAccessStep<
createQuickPickSeparator(),
createDirectiveQuickPickItem(Directive.Cancel),
);
}*/ else {
} else {
directives.push(
createDirectiveQuickPickItem(Directive.StartProTrial, true),
createDirectiveQuickPickItem(Directive.SignIn),
Expand Down
3 changes: 1 addition & 2 deletions src/commands/quickWizard.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ export abstract class QuickWizardCommandBase extends Command {
return;
}

/*
case Directive.StartPreview:
await Container.instance.subscription.startPreviewTrial({
source: 'quick-wizard',
Expand All @@ -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',
Expand Down
1 change: 0 additions & 1 deletion src/constants.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
9 changes: 4 additions & 5 deletions src/plus/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { proTrialLengthInDays } from '../constants.subscription';
import type { Source } from '../constants.telemetry';
import type { Container } from '../container';
import { openUrl } from '../system/vscode/utils';
import { isSubscriptionPaidPlan } from './gk/account/subscription';
import { isSubscriptionPaidPlan, isSubscriptionPreviewTrialExpired } from './gk/account/subscription';

export async function ensurePaidPlan(
container: Container,
title: string,
source: Source,
_?: { allowPreview?: boolean },
options?: { allowPreview?: boolean },
): Promise<boolean> {
while (true) {
const subscription = await container.subscription.getSubscription();
Expand All @@ -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(
Expand All @@ -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 };
Expand Down

0 comments on commit c3bd4d8

Please sign in to comment.