Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(inbox): use history.replaceState for selection to fix post-refresh clicks

Naiyuan Qingb4e8dc37697f
diff --git a/apps/web/app/(dashboard)/inbox/page.tsx b/apps/web/app/(dashboard)/inbox/page.tsx
index 636dc79526..e00ba229ed 100644
--- a/apps/web/app/(dashboard)/inbox/page.tsx
+++ b/apps/web/app/(dashboard)/inbox/page.tsx
@@ -1,6 +1,6 @@
"use client";
-import { useSearchParams, useRouter } from "next/navigation";
+import { useSearchParams } from "next/navigation";
import { useDefaultLayout } from "react-resizable-panels";
import { useInboxStore } from "@/features/inbox";
import { IssueDetail, StatusIcon, PriorityIcon } from "@/features/issues/components";
@@ -191,14 +191,10 @@ function InboxListItem({
export default function InboxPage() {
const searchParams = useSearchParams();
- const router = useRouter();
const selectedId = searchParams.get("id") ?? "";
const setSelectedId = (id: string) => {
- if (id) {
- router.replace(`/inbox?id=${id}`, { scroll: false });
- } else {
- router.replace("/inbox", { scroll: false });
- }
+ const url = id ? `/inbox?id=${id}` : "/inbox";
+ window.history.replaceState(null, "", url);
};
const items = useInboxStore((s) => s.dedupedItems());