Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): revalidate subscription info when open ai usage panel

EYHN6ca174bb142c
diff --git a/packages/frontend/core/src/components/affine/setting-modal/account-setting/ai-usage-panel.tsx b/packages/frontend/core/src/components/affine/setting-modal/account-setting/ai-usage-panel.tsx
index c1c79b5f59..950d82a686 100644
--- a/packages/frontend/core/src/components/affine/setting-modal/account-setting/ai-usage-panel.tsx
+++ b/packages/frontend/core/src/components/affine/setting-modal/account-setting/ai-usage-panel.tsx
@@ -24,6 +24,10 @@ export const AIUsagePanel = () => {
);
const subscriptionService = useService(SubscriptionService);
const aiSubscription = useLiveData(subscriptionService.subscription.ai$);
+ useEffect(() => {
+ // revalidate latest subscription status
+ subscriptionService.subscription.revalidate();
+ }, [subscriptionService]);
const quotaService = useService(UserQuotaService);
useEffect(() => {
quotaService.quota.revalidate();