mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
fix(console): fix inf loop for updating tenant context (#6704)
This commit is contained in:
parent
3022d2eba1
commit
d52f25142d
1 changed files with 12 additions and 10 deletions
|
@ -34,17 +34,19 @@ function Subscription() {
|
|||
useEffect(() => {
|
||||
if (isCloud) {
|
||||
onCurrentSubscriptionUpdated();
|
||||
|
||||
if (periodicUsage) {
|
||||
updateTenant(currentTenantId, {
|
||||
usage: {
|
||||
activeUsers: periodicUsage.mauLimit,
|
||||
tokenUsage: periodicUsage.tokenLimit,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [currentTenantId, onCurrentSubscriptionUpdated, periodicUsage, updateTenant]);
|
||||
}, [onCurrentSubscriptionUpdated]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isCloud && periodicUsage) {
|
||||
updateTenant(currentTenantId, {
|
||||
usage: {
|
||||
activeUsers: periodicUsage.mauLimit,
|
||||
tokenUsage: periodicUsage.tokenLimit,
|
||||
},
|
||||
});
|
||||
}
|
||||
}, [currentTenantId, periodicUsage, updateTenant]);
|
||||
|
||||
if (isLoading) {
|
||||
return <Skeleton />;
|
||||
|
|
Loading…
Add table
Reference in a new issue