mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
15 lines
465 B
TypeScript
15 lines
465 B
TypeScript
import { useEffect } from 'react'
|
|
import { Navigate, useParams } from 'react-router-dom'
|
|
import { useSidebarServerStore } from '@/stores/sidebarServerStore'
|
|
|
|
export function LinkedServerRedirect() {
|
|
const { serverId } = useParams<{ serverId: string }>()
|
|
const selectServer = useSidebarServerStore((state) => state.selectServer)
|
|
|
|
useEffect(() => {
|
|
if (serverId) selectServer(serverId)
|
|
}, [serverId, selectServer])
|
|
|
|
return <Navigate to="/" replace />
|
|
}
|