Skip to content

Commit 39b7c43

Browse files
committed
fix: address CodeRabbit review nitpicks
- Add checkStatus to useEffect dependency array (avoid stale closure) - Redirect unknown dashboard paths to /dashboard instead of showing home
1 parent 4338747 commit 39b7c43

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

frontend/src/components/Dashboard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Routes, Route } from 'react-router-dom'
1+
import { Routes, Route, Navigate } from 'react-router-dom'
22
import { DashboardLayout } from './dashboard/DashboardLayout'
33
import { DashboardHome } from './dashboard/DashboardHome'
44
import { SettingsPage } from '../pages/SettingsPage'
@@ -9,7 +9,7 @@ export function Dashboard() {
99
<Routes>
1010
<Route index element={<DashboardHome />} />
1111
<Route path="settings" element={<SettingsPage />} />
12-
<Route path="*" element={<DashboardHome />} />
12+
<Route path="*" element={<Navigate to="/dashboard" replace />} />
1313
</Routes>
1414
</DashboardLayout>
1515
)

frontend/src/pages/SettingsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function SettingsPage() {
4343
useEffect(() => {
4444
checkStatus()
4545
fetchRepos()
46-
}, [])
46+
}, [checkStatus])
4747

4848
const fetchRepos = async () => {
4949
if (!session?.access_token) return

0 commit comments

Comments
 (0)