mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-28 20:44:50 +02:00
[eric] dashboard: don't wipe layout mid-drag + never route to a phantom (deleted) dashboard id (dragging cards was silently broken by a spurious layout reset)
This commit is contained in:
@@ -255,7 +255,9 @@ const AppShell: React.FC = () => {
|
||||
dispatch(setPendingBrowserUrl(url));
|
||||
const lastId = (window as any).__openswarm_last_dashboard_id as string | undefined;
|
||||
const firstDashboard = dashboardList[0];
|
||||
const targetId = lastId || firstDashboard?.id;
|
||||
// Only navigate to lastId if it's a REAL dashboard: a stale localStorage id for a deleted dashboard used to route to /dashboard/<phantom>, which 404s and re-fires the layout wipe (drops your cards / breaks a drag).
|
||||
const lastIsReal = !!lastId && dashboardList.some((d) => d.id === lastId);
|
||||
const targetId = (lastIsReal ? lastId : undefined) || firstDashboard?.id;
|
||||
if (targetId) {
|
||||
navigate(`/dashboard/${targetId}`);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user