Skip to content

Commit

Permalink
fix(nui): Reset route on open event
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWasTakenn committed Jan 6, 2022
1 parent cbf47dc commit 4d07862
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { Center, Box } from '@chakra-ui/react';
import { debugData } from '../utils/debugData';
import TopBar from './NavBars/TopBar';
import LeftBar from './NavBars/LeftBar';
import { Routes, Route } from 'react-router-dom';
import { Routes, Route, useNavigate } from 'react-router-dom';
import Resource from './Resource';
import RightBar from './NavBars/RightBar';
import MainContent from './MainContent';
import { useNuiEvent } from '../hooks/useNuiEvent';

debugData([
{
Expand All @@ -19,6 +20,10 @@ debugData([
]);

const App: React.FC = () => {
const navigate = useNavigate();

useNuiEvent('openUI', () => navigate('/'));

return (
<Center w="100%" h="100%">
<Box
Expand Down

0 comments on commit 4d07862

Please sign in to comment.