Skip to content

Commit cfa317a

Browse files
committed
fix: prevent redirect when navigating to retrieval-check
The diagnostics page was redirecting to /logs when clicking "Check Retrieval" from the Files context menu. This happened because the redirect logic fired too early, before the full route was available. Fixed by checking the complete URL path before redirecting.
1 parent 93ba7f4 commit cfa317a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/diagnostics/diagnostics-content.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ const DiagnosticsContent: React.FC<DiagnosticsContentProps> = () => {
6464

6565
// Redirect from /diagnostics or /diagnostics/ to /diagnostics/logs
6666
useEffect(() => {
67-
if (path === '' || path === '/') {
67+
// Only redirect if we're actually at the root diagnostics path
68+
// Check the full URL to avoid redirecting when navigating to sub-paths
69+
const fullUrl = routeInfo?.url ?? ''
70+
if ((path === '' || path === '/') && (fullUrl === '/diagnostics' || fullUrl === '/diagnostics/')) {
6871
window.location.replace('#/diagnostics/logs')
6972
}
70-
}, [path])
73+
}, [path, routeInfo?.url])
7174

7275
const isMounted = useRef(false)
7376
useEffect(() => {

0 commit comments

Comments
 (0)