Fix controls page tab navigation (#10125)

This commit is contained in:
Luke Heath 2023-02-27 13:33:14 -06:00 committed by GitHub
parent 728c47fa34
commit 8c4d4b1763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,9 +54,12 @@ const ManageControlsPage = ({
location,
router,
}: IManageControlsPageProps): JSX.Element => {
const { availableTeams, isPremiumTier, setCurrentTeam } = useContext(
AppContext
);
const {
availableTeams,
isPremiumTier,
currentTeam,
setCurrentTeam,
} = useContext(AppContext);
const { data: mdmApple, isLoading: isLoadingMdmApple } = useQuery<
IMdmApple,
@ -69,7 +72,9 @@ const ManageControlsPage = ({
const navigateToNav = (i: number): void => {
const navPath = controlsSubNav[i].pathname;
router.push(navPath);
const teamId = currentTeam?.id || undefined;
const queryString = teamId === undefined ? "" : `?team_id=${teamId}`;
router.replace(navPath + queryString);
};
const handleTeamSelect = (ctx: ITeamsDropdownState) => {