Skip to content

Commit dded201

Browse files
atrakhConvex, Inc.
authored andcommitted
dashboard: consume showSchemaAndIndexes query param after opening the panel (#39318)
GitOrigin-RevId: d9a83a6b5daa2f4bd4d441bfbd66454a281327f6
1 parent f753b81 commit dded201

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

npm-packages/dashboard-common/src/features/data/components/DataContent.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { getDefaultIndex } from "@common/features/data/components/DataFilters/In
5555
import { useMount } from "react-use";
5656
import { api } from "system-udfs/convex/_generated/api";
5757
import { useNents } from "@common/lib/useNents";
58+
import omit from "lodash/omit";
5859

5960
export function DataContent({
6061
tableName,
@@ -180,17 +181,12 @@ export function DataContent({
180181

181182
// Handle query parameter to open schema popup
182183
useEffect(() => {
183-
if (router.query.showSchemaAndIndexes === "true" && !popupState.popup) {
184+
if (!!router.query.showSchemaAndIndexes && !popupState.popup) {
184185
popupState.setPopup({ type: "viewSchema", tableName });
185-
}
186-
const isSchemaPopupOpen = popupState.popup?.type === "viewSchema";
187-
const hasSchemaParam = router.query.showSchemaAndIndexes === "true";
188-
if (isSchemaPopupOpen && !hasSchemaParam) {
189-
// Schema popup opened, add query param
190186
void router.push(
191187
{
192188
pathname: router.pathname,
193-
query: { ...router.query, showSchemaAndIndexes: "true" },
189+
query: omit(router.query, "showSchemaAndIndexes"),
194190
},
195191
undefined,
196192
{ shallow: true },

0 commit comments

Comments
 (0)