double details fix
This commit is contained in:
parent
450cb50991
commit
4ae1a50a77
1 changed files with 7 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ import { useRouter, useSearchParams } from "next/navigation";
|
|||
import dynamic from "next/dynamic";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
// Existing canonical pages
|
||||
// Existing canonical pages (Fiber/UV/Gantry still use their pages for now)
|
||||
const FiberPanel = dynamic(() => import("@/app/settings/fiber/page"), { ssr: false });
|
||||
const UVPanel = dynamic(() => import("@/app/settings/uv/page"), { ssr: false });
|
||||
const CO2GalvoPanel = dynamic(() => import("@/components/portal/panels/CO2GalvoPanel"), { ssr: false });
|
||||
|
|
@ -88,6 +88,11 @@ export default function SettingsSwitcher() {
|
|||
const q = new URLSearchParams(sp.toString());
|
||||
q.set("t", nextKey);
|
||||
|
||||
// Clear detail-related params when switching tabs to avoid stale state
|
||||
q.delete("view");
|
||||
q.delete("id");
|
||||
q.delete("edit");
|
||||
|
||||
// keep track of last data tab so the Add tab knows which target to preselect
|
||||
if (nextKey === "add") {
|
||||
q.set("last", isDataTab(active) ? (active as DataTab) : lastDataTab);
|
||||
|
|
@ -115,7 +120,7 @@ export default function SettingsSwitcher() {
|
|||
))}
|
||||
</div>
|
||||
|
||||
{/* Removed the extra border/padding wrapper to avoid double-framing */}
|
||||
{/* No extra border/padding wrapper → avoids double-framing */}
|
||||
<Panel tab={active} lastDataTab={lastDataTab} />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue