Skip to content

Commit b3fc19e

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(tables): clear deleted embedded view state
1 parent acfef82 commit b3fc19e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/tables/[tableId]

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,9 @@ export function Table({
597597
return
598598
}
599599
// A `?view=` that resolves to nothing (deleted view, stale bookmark) falls
600-
// back to "All" without touching state, for the same reason. An explicit
601-
// `?sort=` alongside `?view=` also wins over the view's stored sort.
600+
// back to "All". An explicit `?sort=` alongside a page `?view=` still wins,
601+
// but an embedded View resource must clear the host page's inherited state:
602+
// none of it belongs to the missing View the resource requested.
602603
seededViewIdRef.current = activeView?.id ?? null
603604
resolvePendingLayout(activeView !== null)
604605
if (activeView) {
@@ -608,6 +609,7 @@ export function Table({
608609
// Rewrite it so a stale bookmark can't be copied on, and so the param
609610
// matches the All the UI is already showing.
610611
setActiveViewId(ALL_VIEW_PARAM)
612+
if (propViewId) applyViewConfig(null)
611613
}
612614
return
613615
}
@@ -647,6 +649,7 @@ export function Table({
647649
activeView,
648650
activeViewId,
649651
embedded,
652+
propViewId,
650653
sortColumn,
651654
applyViewConfig,
652655
setActiveViewId,

0 commit comments

Comments
 (0)