mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-26 23:26:04 +00:00
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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user