fix: don't offer a seat a plan link it cannot use

The Usage card's Upgrade link relabels to "Manage →" for anyone on a
plan, including a seat whose plan is its team's. Following it only
reaches a dialog saying so. Hidden for a seat, unchanged for everyone
else.
This commit is contained in:
Juan Castro
2026-09-11 18:00:53 -04:00
parent de74b0c488
commit 8d90418c9e
+6
View File
@@ -21,6 +21,7 @@ import UIWindowSaveAccount from '../UIWindowSaveAccount.js';
import { formatCredits, formatDollarsFromMicrocents, usageIsCredits } from './credits.js';
import { usageBudget } from './usageBudget.js';
import { appIconAttrs } from '../../helpers/appIcon.js';
import { isOrgSeat } from './orgSeat.js';
// How long a completed usage load stays fresh enough to skip a repeat. Long
// enough to absorb the init/onActivate/routing burst on a single dashboard
@@ -519,6 +520,11 @@ const TabHome = {
$el_window.find('.bento-plan-upgrade').text('Upgrade →').show();
}
// A seat's plan is the team's; the link only reaches a refusal.
if ( isOrgSeat(window.user) ) {
$el_window.find('.bento-plan-upgrade').hide();
}
$el_window
.find('.bento-plan-upgrade')
.off('click.billing')