mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 11:06:25 +08:00
feat(core): compatible with multiple subscriptions (#6277)
This commit is contained in:
@@ -4,7 +4,7 @@ import { Loading } from '@affine/component/ui/loading';
|
||||
import { AffineShapeIcon } from '@affine/core/components/page-list';
|
||||
import { useCredentialsRequirement } from '@affine/core/hooks/affine/use-server-config';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import type { SubscriptionPlan, SubscriptionRecurring } from '@affine/graphql';
|
||||
import { SubscriptionPlan, type SubscriptionRecurring } from '@affine/graphql';
|
||||
import {
|
||||
changePasswordMutation,
|
||||
createCheckoutSessionMutation,
|
||||
@@ -138,7 +138,11 @@ const SubscriptionRedirectWithData = () => {
|
||||
);
|
||||
}
|
||||
|
||||
if (subscriptionData.currentUser?.subscription) {
|
||||
if (
|
||||
subscriptionData.currentUser?.subscriptions?.some(
|
||||
sub => sub.plan === SubscriptionPlan.Pro
|
||||
)
|
||||
) {
|
||||
return <SubscriptionExisting />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user