Fix undefined tabValue (#6694)

This commit is contained in:
Xander Luciano 2024-03-13 01:05:53 -07:00 committed by GitHub
parent 891c4fef6a
commit 128fa95f71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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';
@ -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