mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-06 02:41:48 +00:00
fix(dashboard): defer unknown-route redirect while dashboard plugins load
This commit is contained in:
parent
986ec04048
commit
06a6d6967a
1 changed files with 22 additions and 1 deletions
|
|
@ -80,6 +80,25 @@ function RootRedirect() {
|
|||
return <Navigate to="/sessions" replace />;
|
||||
}
|
||||
|
||||
function UnknownRouteFallback({ pluginsLoading }: { pluginsLoading: boolean }) {
|
||||
if (!pluginsLoading) {
|
||||
return <Navigate to="/sessions" replace />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="flex min-h-[16rem] min-w-0 items-center justify-center"
|
||||
aria-busy="true"
|
||||
aria-live="polite"
|
||||
>
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<Spinner />
|
||||
<span>Loading dashboard plugins…</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const CHAT_NAV_ITEM: NavItem = {
|
||||
path: "/chat",
|
||||
labelKey: "chat",
|
||||
|
|
@ -582,7 +601,9 @@ export default function App() {
|
|||
))}
|
||||
<Route
|
||||
path="*"
|
||||
element={<Navigate to="/sessions" replace />}
|
||||
element={
|
||||
<UnknownRouteFallback pluginsLoading={pluginsLoading} />
|
||||
}
|
||||
/>
|
||||
</Routes>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue