mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-07 04:27:16 +03:00
fix(core): checkout event (#7844)
This commit is contained in:
parent
dc41ffbe2f
commit
69c64b2fc2
@ -129,7 +129,7 @@ export const useSubscriptionNotifyReader = () => {
|
|||||||
upgradeNotify(link);
|
upgradeNotify(link);
|
||||||
localStorage.removeItem(localStorageKey);
|
localStorage.removeItem(localStorageKey);
|
||||||
|
|
||||||
track.$.$.$.checkout({
|
track.$.settingsPanel.plans.subscribe({
|
||||||
plan,
|
plan,
|
||||||
recurring,
|
recurring,
|
||||||
});
|
});
|
||||||
|
@ -96,6 +96,7 @@ type PaymentEvents =
|
|||||||
| 'viewPlans'
|
| 'viewPlans'
|
||||||
| 'bookDemo'
|
| 'bookDemo'
|
||||||
| 'checkout'
|
| 'checkout'
|
||||||
|
| 'subscribe'
|
||||||
| 'changeSubscriptionRecurring'
|
| 'changeSubscriptionRecurring'
|
||||||
| 'confirmChangingSubscriptionRecurring'
|
| 'confirmChangingSubscriptionRecurring'
|
||||||
| 'cancelSubscription'
|
| 'cancelSubscription'
|
||||||
@ -155,6 +156,7 @@ const PageEvents = {
|
|||||||
accountSettings: ['uploadAvatar', 'removeAvatar', 'updateUserName'],
|
accountSettings: ['uploadAvatar', 'removeAvatar', 'updateUserName'],
|
||||||
plans: [
|
plans: [
|
||||||
'checkout',
|
'checkout',
|
||||||
|
'subscribe',
|
||||||
'changeSubscriptionRecurring',
|
'changeSubscriptionRecurring',
|
||||||
'confirmChangingSubscriptionRecurring',
|
'confirmChangingSubscriptionRecurring',
|
||||||
'cancelSubscription',
|
'cancelSubscription',
|
||||||
@ -346,6 +348,7 @@ export type EventArgs = {
|
|||||||
oauth: { provider: string };
|
oauth: { provider: string };
|
||||||
viewPlans: PaymentEventArgs;
|
viewPlans: PaymentEventArgs;
|
||||||
checkout: PaymentEventArgs;
|
checkout: PaymentEventArgs;
|
||||||
|
subscribe: PaymentEventArgs;
|
||||||
cancelSubscription: PaymentEventArgs;
|
cancelSubscription: PaymentEventArgs;
|
||||||
confirmCancelingSubscription: PaymentEventArgs;
|
confirmCancelingSubscription: PaymentEventArgs;
|
||||||
resumeSubscription: PaymentEventArgs;
|
resumeSubscription: PaymentEventArgs;
|
||||||
|
@ -70,10 +70,7 @@ export const Component = () => {
|
|||||||
: !!subscriptionService.subscription.pro$.value;
|
: !!subscriptionService.subscription.pro$.value;
|
||||||
if (!subscribed) {
|
if (!subscribed) {
|
||||||
setMessage('Creating checkout...');
|
setMessage('Creating checkout...');
|
||||||
track.subscriptionLanding.$.$.checkout({
|
|
||||||
plan: receivedPlan,
|
|
||||||
recurring: receivedRecurring,
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
const account = authService.session.account$.value;
|
const account = authService.session.account$.value;
|
||||||
// should never reach
|
// should never reach
|
||||||
@ -88,6 +85,13 @@ export const Component = () => {
|
|||||||
: receivedRecurring === 'yearly'
|
: receivedRecurring === 'yearly'
|
||||||
? SubscriptionRecurring.Yearly
|
? SubscriptionRecurring.Yearly
|
||||||
: SubscriptionRecurring.Lifetime;
|
: SubscriptionRecurring.Lifetime;
|
||||||
|
|
||||||
|
track.subscriptionLanding.$.$.checkout({
|
||||||
|
control: 'pricing',
|
||||||
|
plan: targetPlan,
|
||||||
|
recurring: targetRecurring,
|
||||||
|
});
|
||||||
|
|
||||||
const checkout = await subscriptionService.createCheckoutSession({
|
const checkout = await subscriptionService.createCheckoutSession({
|
||||||
idempotencyKey,
|
idempotencyKey,
|
||||||
plan: targetPlan,
|
plan: targetPlan,
|
||||||
|
Loading…
Reference in New Issue
Block a user