File tree 2 files changed +17
-7
lines changed
2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -152,9 +152,6 @@ export default function Menu() {
152
152
server . isStudent ( ) . then ( ( v ) => ( ) => setIsStudent ( v ) ) ,
153
153
server . isChargebeeCustomer ( ) . then ( ( v ) => ( ) => setIsChargebeeCustomer ( v ) ) ,
154
154
] ) . then ( ( setters ) => setters . forEach ( ( s ) => s ( ) ) ) ;
155
-
156
- // Refresh billing mode
157
- refreshUserBillingMode ( ) ;
158
155
} , [ ] ) ;
159
156
160
157
useEffect ( ( ) => {
@@ -163,6 +160,11 @@ export default function Menu() {
163
160
}
164
161
} , [ team ] ) ;
165
162
163
+ useEffect ( ( ) => {
164
+ // Refresh billing mode
165
+ refreshUserBillingMode ( ) ;
166
+ } , [ teams ] ) ;
167
+
166
168
const teamOrUserSlug = ! ! team ? "/t/" + team . slug : "/projects" ;
167
169
const leftMenu : Entry [ ] = ( ( ) => {
168
170
// Project menu
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import { UserContext } from "../user-context";
28
28
type PendingPlan = Plan & { pendingSince : number } ;
29
29
30
30
export default function TeamBilling ( ) {
31
- const { user, userBillingMode } = useContext ( UserContext ) ;
31
+ const { user } = useContext ( UserContext ) ;
32
32
const { teams } = useContext ( TeamsContext ) ;
33
33
const location = useLocation ( ) ;
34
34
const team = getCurrentTeam ( location , teams ) ;
@@ -308,15 +308,23 @@ export default function TeamBilling() {
308
308
) ;
309
309
}
310
310
311
- const showUBP = BillingMode . showUsageBasedBilling ( userBillingMode ) ;
311
+ const showUBP = BillingMode . showUsageBasedBilling ( teamBillingMode ) ;
312
312
return (
313
313
< PageWithSubMenu
314
314
subMenu = { getTeamSettingsMenu ( { team, billingMode : teamBillingMode } ) }
315
315
title = "Billing"
316
316
subtitle = "Manage team billing and plans."
317
317
>
318
- { showUBP && < TeamUsageBasedBilling /> }
319
- { ! showUBP && renderTeamBilling ( ) }
318
+ { teamBillingMode === undefined ? (
319
+ < div className = "p-20" >
320
+ < Spinner className = "h-5 w-5 animate-spin" />
321
+ </ div >
322
+ ) : (
323
+ < >
324
+ { showUBP && < TeamUsageBasedBilling /> }
325
+ { ! showUBP && renderTeamBilling ( ) }
326
+ </ >
327
+ ) }
320
328
</ PageWithSubMenu >
321
329
) ;
322
330
}
You can’t perform that action at this time.
0 commit comments