fix(billing-ui): open settings when enterprise sub folks press usage indicator (#1194)

This commit is contained in:
Waleed
2025-08-29 16:11:32 -07:00
committed by GitHub
parent 7fcbafab97
commit 7e23e942d7

View File

@@ -1007,8 +1007,11 @@ export function Sidebar() {
>
<UsageIndicator
onClick={() => {
const isBlocked = useSubscriptionStore.getState().getBillingStatus() === 'blocked'
if (isBlocked) {
const subscriptionStore = useSubscriptionStore.getState()
const isBlocked = subscriptionStore.getBillingStatus() === 'blocked'
const canUpgrade = subscriptionStore.canUpgrade()
if (isBlocked || !canUpgrade) {
if (typeof window !== 'undefined') {
window.dispatchEvent(
new CustomEvent('open-settings', { detail: { tab: 'subscription' } })