Skip to content

Commit

Permalink
fix failing tests (#3817)
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Feb 2, 2022
1 parent 850487b commit c7e1940
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export function useGridColumns(
return prevState;
}

const columnVisibilityModelToExport = gridColumnVisibilityModelSelector(apiRef.current.state);
const columnVisibilityModelToExport = gridColumnVisibilityModelSelector(apiRef);
const hasHiddenColumns = Object.values(columnVisibilityModelToExport).some(
(value) => value === false,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export const useGridFilter = (
*/
const stateExportPreProcessing = React.useCallback<GridPreProcessor<'exportState'>>(
(prevState) => {
const filterModelToExport = gridFilterModelSelector(apiRef.current.state);
const filterModelToExport = gridFilterModelSelector(apiRef);
if (
filterModelToExport.items.length === 0 &&
filterModelToExport.linkOperator === getDefaultGridFilterModel().linkOperator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const useGridPage = (
*/
const stateExportPreProcessing = React.useCallback<GridPreProcessor<'exportState'>>(
(prevState) => {
const pageToExport = gridPageSelector(apiRef.current.state);
const pageToExport = gridPageSelector(apiRef);
if (pageToExport === 0) {
return prevState;
}
Expand All @@ -115,8 +115,7 @@ export const useGridPage = (
const stateRestorePreProcessing = React.useCallback<GridPreProcessor<'restoreState'>>(
(params, context) => {
// We apply the constraint even if the page did not change in case the pageSize changed.
const page =
context.stateToRestore.pagination?.page ?? gridPageSelector(apiRef.current.state);
const page = context.stateToRestore.pagination?.page ?? gridPageSelector(apiRef);
apiRef.current.setState(mergeStateWithPage(page));
return params;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const useGridPageSize = (
*/
const stateExportPreProcessing = React.useCallback<GridPreProcessor<'exportState'>>(
(prevState) => {
const pageSizeToExport = gridPageSizeSelector(apiRef.current.state);
const pageSizeToExport = gridPageSizeSelector(apiRef);
if (pageSizeToExport === defaultPageSize) {
return prevState;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export const useGridRowGrouping = (
return prevState;
}

const rowGroupingModelToExport = gridRowGroupingModelSelector(apiRef.current.state);
const rowGroupingModelToExport = gridRowGroupingModelSelector(apiRef);
if (rowGroupingModelToExport.length === 0) {
return prevState;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const useGridSorting = (
*/
const stateExportPreProcessing = React.useCallback<GridPreProcessor<'exportState'>>(
(prevState) => {
const sortModelToExport = gridSortModelSelector(apiRef.current.state);
const sortModelToExport = gridSortModelSelector(apiRef);
if (sortModelToExport.length === 0) {
return prevState;
}
Expand Down

0 comments on commit c7e1940

Please sign in to comment.