-
-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove useNewSubscriptionData manual updateTenant
- Loading branch information
Showing
1 changed file
with
3 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
|
@@ -50,13 +50,7 @@ const useNewSubscriptionData: () => NewSubscriptionContext & { isLoading: boolea | |
[currentTenant?.planId, logtoSkus] | ||
); | ||
|
||
useEffect(() => { | ||
if (subscriptionUsageData?.quota) { | ||
updateTenant(tenantId, { | ||
quota: pick(subscriptionUsageData.quota, 'mauLimit', 'tokenLimit'), | ||
}); | ||
} | ||
}, [tenantId, subscriptionUsageData?.quota, updateTenant]); | ||
// TODO: @darcyYe can use `updateTenant()` to manually update the quota of the current tenant. Previously we removed such logic to unblock the release since it breaks the Cloud console integration tests. | ||
Check warning on line 53 in packages/console/src/contexts/SubscriptionDataProvider/use-new-subscription-data.ts GitHub Actions / ESLint Report Analysispackages/console/src/contexts/SubscriptionDataProvider/use-new-subscription-data.ts#L53
|
||
|
||
return useMemo( | ||
() => ({ | ||
|