Skip to content

Commit

Permalink
Fix undefined tabValue
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderLuciano committed Mar 13, 2024
1 parent b333146 commit 1620e7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/frontend/src/components/nav/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useDisclosure } from '@mantine/hooks';
import { IconBell, IconSearch } from '@tabler/icons-react';
import { useQuery } from '@tanstack/react-query';
import { useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { useMatch, useNavigate, useParams } from 'react-router-dom';

import { api } from '../../App';
import { navTabs as mainNavTabs } from '../../defaults/links';
Expand Down Expand Up @@ -100,8 +100,9 @@ export function Header() {

function NavTabs() {
const { classes } = InvenTreeStyle();
const { tabValue } = useParams();
const navigate = useNavigate();
const match = useMatch(':tabName/*');
const tabValue = match?.params.tabName;

return (
<Tabs
Expand Down

0 comments on commit 1620e7e

Please sign in to comment.