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

@ -22,10 +22,12 @@ export const useViewSorts = <SortField>({
availableSorts,
currentViewId,
scopeContext,
skipFetch,
}: {
availableSorts: SortType<SortField>[];
currentViewId: string | undefined;
scopeContext: Context<string | null>;
skipFetch?: boolean;
}) => {
const [sorts, setSorts] = useRecoilScopedState(
sortsScopedState,
@ -39,7 +41,7 @@ export const useViewSorts = <SortField>({
);
const { refetch } = useGetViewSortsQuery({
skip: !currentViewId,
skip: !currentViewId || skipFetch,
variables: {
where: {
viewId: { equals: currentViewId },