fix: use correct table view when switching workspaces (#1447)

Closes #1441
This commit is contained in:
Thaïs
2023-09-05 12:40:45 +02:00
committed by GitHub
parent 53f3c1691d
commit b3887c6bcc
5 changed files with 95 additions and 86 deletions

View File

@ -43,9 +43,11 @@ const toViewFieldInput = (
export const useTableViewFields = ({
objectId,
columnDefinitions,
skipFetch,
}: {
objectId: 'company' | 'person';
columnDefinitions: ColumnDefinition<ViewFieldMetadata>[];
skipFetch?: boolean;
}) => {
const currentTableViewId = useRecoilScopedValue(
currentTableViewIdState,
@ -113,7 +115,7 @@ export const useTableViewFields = ({
);
const { refetch } = useGetViewFieldsQuery({
skip: !currentTableViewId,
skip: !currentTableViewId || skipFetch,
variables: {
orderBy: { index: SortOrder.Asc },
where: {