mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 00:11:33 +03:00
fix(core): fix subscribe link for pro plan (#6627)
This commit is contained in:
parent
9d412d22cb
commit
4085cc6728
@ -46,6 +46,11 @@ export class Subscription extends Entity {
|
||||
? subscriptions.some(sub => sub.plan === SubscriptionPlan.Pro)
|
||||
: null
|
||||
);
|
||||
pro$ = this.subscription$.map(subscriptions =>
|
||||
subscriptions
|
||||
? subscriptions.find(sub => sub.plan === SubscriptionPlan.Pro)
|
||||
: null
|
||||
);
|
||||
isSelfHosted$ = this.subscription$.map(subscriptions =>
|
||||
subscriptions
|
||||
? subscriptions.some(sub => sub.plan === SubscriptionPlan.SelfHosted)
|
||||
|
@ -46,7 +46,10 @@ export const Component = () => {
|
||||
}
|
||||
setMessage('Checking subscription status...');
|
||||
await subscriptionService.subscription.waitForRevalidation(signal);
|
||||
const subscribed = !!subscriptionService.subscription.ai$.value;
|
||||
const subscribed =
|
||||
plan?.toLowerCase() === 'ai'
|
||||
? !!subscriptionService.subscription.ai$.value
|
||||
: !!subscriptionService.subscription.pro$.value;
|
||||
if (!subscribed) {
|
||||
setMessage('Creating checkout...');
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user