fix(web): offer recovery from missing pages (#11314)
This commit is contained in:
1 parent
20363c32c9
commit
4a39cade98
1 file changed
+17
@@ -3,6 +3,7 @@ import { scopedProjectKey, scopeProjectRef } from "@t3tools/client-runtime/envir
|
||||
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
|
||||
import {
|
||||
Outlet,
|
||||
Link,
|
||||
redirect,
|
||||
createRootRoute,
|
||||
type ErrorComponentProps,
|
||||
@@ -104,11 +105,27 @@ export const Route = createRootRoute({
|
||||
},
|
||||
component: RootRouteView,
|
||||
errorComponent: RootRouteErrorView,
|
||||
notFoundComponent: RootRouteNotFoundView,
|
||||
head: () => ({
|
||||
meta: [{ name: "title", content: APP_DISPLAY_NAME }],
|
||||
}),
|
||||
});
|
||||
|
||||
function RootRouteNotFoundView() {
|
||||
return (
|
||||
<main className="flex min-h-0 min-w-0 flex-1 items-center justify-center p-6">
|
||||
<div className="flex max-w-sm flex-col items-center gap-4 text-center">
|
||||
<h1 className="text-lg font-medium text-foreground">Page not found</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
This link doesn't point to a page in {APP_DISPLAY_NAME}. Go home to choose a project or
|
||||
start a thread.
|
||||
</p>
|
||||
<Button render={<Link to="/" replace />}>Go home</Button>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
function RootRouteView() {
|
||||
useEffect(() => installDesktopPasteAsText(window.desktopBridge, window), []);
|
||||
const pathname = useLocation({ select: (location) => location.pathname });
|
||||
|
||||
Reference in new issue
Block a user