0
Fork 0
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:
Darcy Ye 2024-10-22 11:01:39 +08:00 committed by GitHub
parent 3022d2eba1
commit d52f25142d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 />;