Skip to content

Commit c6db4d8

Browse files
committed
[dashboard] fix greedy redirect on team usage page
1 parent 3b40ecc commit c6db4d8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

components/dashboard/src/teams/TeamUsage.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,14 @@ function TeamUsage() {
7171
})();
7272
}, [team, startDateOfBillMonth, endDateOfBillMonth, isStartedTimeDescending]);
7373

74-
if (!BillingMode.showUsageBasedBilling(teamBillingMode)) {
75-
return <Redirect to="/" />;
76-
}
74+
useEffect(() => {
75+
if (!teamBillingMode) {
76+
return;
77+
}
78+
if (!BillingMode.showUsageBasedBilling(teamBillingMode)) {
79+
window.location.href = gitpodHostUrl.asDashboard().toString();
80+
}
81+
}, [teamBillingMode]);
7782

7883
const getType = (type: BillableWorkspaceType) => {
7984
if (type === "regular") {

0 commit comments

Comments
 (0)