Skip to content

Commit

Permalink
chore: remove useNewSubscriptionData manual updateTenant
Browse files Browse the repository at this point in the history
  • Loading branch information
darcyYe committed Oct 22, 2024
1 parent 95c7d8b commit 33d3409
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cond, condString, pick } from '@silverhand/essentials';
import { useContext, useEffect, useMemo } from 'react';
import { cond, condString } from '@silverhand/essentials';
import { useContext, useMemo } from 'react';
import useSWR from 'swr';

import { useCloudApi } from '@/cloud/hooks/use-cloud-api';
Expand Down Expand Up @@ -50,13 +50,13 @@ const useNewSubscriptionData: () => NewSubscriptionContext & { isLoading: boolea
[currentTenant?.planId, logtoSkus]
);

useEffect(() => {
if (subscriptionUsageData?.quota) {
updateTenant(tenantId, {
quota: pick(subscriptionUsageData.quota, 'mauLimit', 'tokenLimit'),
});
}
}, [tenantId, subscriptionUsageData?.quota, updateTenant]);
// UseEffect(() => {
// if (subscriptionUsageData?.quota) {
// updateTenant(tenantId, {
// quota: pick(subscriptionUsageData.quota, 'mauLimit', 'tokenLimit'),
// });
// }
// }, [tenantId, subscriptionUsageData?.quota, updateTenant]);

return useMemo(
() => ({
Expand Down

0 comments on commit 33d3409

Please sign in to comment.