refactor: ensure consistent routing

This commit is contained in:
cv
2022-11-22 22:02:25 +01:00
parent 139f466beb
commit ed3554d033
+3 -3
View File
@@ -1,5 +1,5 @@
import { lazy, useEffect } from 'react'; import { lazy, useEffect } from 'react';
import { Route, Routes, useLocation, useNavigate } from 'react-router-dom'; import { Navigate, Route, Routes, useLocation, useNavigate } from 'react-router-dom';
import useAliases from './common/hooks-query/useAliases'; import useAliases from './common/hooks-query/useAliases';
import withSocket from './features/viewers/ViewWrapper'; import withSocket from './features/viewers/ViewWrapper';
@@ -52,7 +52,7 @@ export default function AppRouter() {
return( return(
<Routes> <Routes>
<Route path='/' element={<STimer />} /> <Route path='/' element={<Navigate to="/timer" /> } />
<Route path='/speaker' element={<STimer />} /> <Route path='/speaker' element={<STimer />} />
<Route path='/presenter' element={<STimer />} /> <Route path='/presenter' element={<STimer />} />
<Route path='/stage' element={<STimer />} /> <Route path='/stage' element={<STimer />} />
@@ -115,7 +115,7 @@ export default function AppRouter() {
} }
/> />
{/* Send to default if nothing found */} {/* Send to default if nothing found */}
<Route path='*' element={<STimer />} /> <Route path='*' element={<Navigate to="/timer" /> } />
</Routes> </Routes>
) )
} }