fix: improve quota check logic in InviteUserButton for better reliability

This commit is contained in:
Eric Hilse
2025-11-26 08:40:33 -07:00
parent 87484c8168
commit c80726eaf6
@@ -20,7 +20,8 @@ export function InviteUserButton() {
// Check if org_user quota is reached
const userQuota = quotas?.find((quota) => quota.target === 'org_user');
const isQuotaReached = userQuota ? userQuota.used! >= userQuota.limit! : false;
const isQuotaReached =
userQuota != null && userQuota.used != null && userQuota.limit != null && userQuota.used >= userQuota.limit;
// Only show upgrade button on Grafana Cloud when quota is reached
const shouldShowUpgrade = isCloudInstance && isQuotaReached;