From b80c08a2f538df7c55d594052bb478d39cda9975 Mon Sep 17 00:00:00 2001 From: Sidney Alcantara Date: Tue, 11 Oct 2022 12:18:46 +1100 Subject: [PATCH] fix table name not in tab name --- src/pages/Table/ProvidedTablePage.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/Table/ProvidedTablePage.tsx b/src/pages/Table/ProvidedTablePage.tsx index f609ac4c..35a1c887 100644 --- a/src/pages/Table/ProvidedTablePage.tsx +++ b/src/pages/Table/ProvidedTablePage.tsx @@ -15,6 +15,7 @@ import TableSkeleton from "@src/components/Table/TableSkeleton"; import { projectScope, + projectIdAtom, currentUserAtom, projectSettingsAtom, tablesAtom, @@ -24,6 +25,7 @@ import { tableIdAtom, tableSettingsAtom, } from "@src/atoms/tableScope"; +import useDocumentTitle from "@src/hooks/useDocumentTitle"; /** * Wraps `TablePage` with the data for a top-level table. @@ -32,11 +34,14 @@ import { export default function ProvidedTablePage() { const { id } = useParams(); const outlet = useOutlet(); + const [projectId] = useAtom(projectIdAtom, projectScope); const [currentUser] = useAtom(currentUserAtom, projectScope); const [projectSettings] = useAtom(projectSettingsAtom, projectScope); const [tables] = useAtom(tablesAtom, projectScope); const tableSettings = useMemo(() => find(tables, ["id", id]), [tables, id]); + useDocumentTitle(projectId, tableSettings ? tableSettings.name : "Not found"); + if (!tableSettings) { if (isEmpty(projectSettings)) { return (