Skip to content

Commit

Permalink
fix: update thread back button to navigate back in browser history
Browse files Browse the repository at this point in the history
- previously just went back to all threads page
  • Loading branch information
ryanhopperlowe committed Jan 7, 2025
1 parent 672d8c1 commit 65d88ff
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ui/admin/app/routes/_auth.threads.$id.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ArrowLeftIcon } from "lucide-react";
import {
ClientLoaderFunctionArgs,
Link,
MetaFunction,
redirect,
useLoaderData,
useMatch,
useNavigate,
} from "react-router";
import { $path } from "safe-routes";

Expand Down Expand Up @@ -82,6 +82,7 @@ export default function ChatAgent() {

const entity = getEntity();

const navigate = useNavigate();
return (
<div className="h-full flex flex-col overflow-hidden relative">
<Tooltip>
Expand All @@ -92,9 +93,13 @@ export default function ChatAgent() {
asChild
>
<TooltipTrigger>
<Link to="/threads">
<Button
size="icon"
variant="outline"
onClick={() => navigate(-1)}
>
<ArrowLeftIcon className="h-4 w-4" />
</Link>
</Button>
</TooltipTrigger>
</Button>
<TooltipContent>Go Back</TooltipContent>
Expand Down

0 comments on commit 65d88ff

Please sign in to comment.