fix table name not in tab name

This commit is contained in:
Sidney Alcantara
2022-10-11 12:18:46 +11:00
parent 964f96a125
commit b80c08a2f5

View File

@@ -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 (