Skip to content

Commit

Permalink
make changes based on comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshatJawne committed Aug 22, 2024
1 parent 7d8f09e commit bb7c663
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/iris-grid/src/IrisGridModelUpdater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function IrisGridModelUpdater({
partitionConfig,
showExtraGroupColumn,
}: IrisGridModelUpdaterProps): JSX.Element | null {
const { isTotalsAvailable, isRollupAvailable } = model;
// Check for showExtraGroupColumn before memoizing columns, since updating it will change the columns
useOnChange(() => {
if (isIrisGridTreeTableModel(model) && showExtraGroupColumn != null) {
Expand Down Expand Up @@ -139,12 +140,11 @@ function IrisGridModelUpdater({
);
useOnChange(
function updateRollupCOnfig() {
if (model.isRollupAvailable) {
if (isRollupAvailable) {
model.rollupConfig = rollupConfig;
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[model, model.rollupConfig, rollupConfig]
[model, isRollupAvailable, rollupConfig]
);
useOnChange(
function updateSelectDistinctColumns() {
Expand All @@ -156,12 +156,11 @@ function IrisGridModelUpdater({
);
useOnChange(
function updateTotalsConfig() {
if (model.isTotalsAvailable) {
if (isTotalsAvailable) {
model.totalsConfig = totalsConfig;
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[model, model.isTotalsAvailable, totalsConfig]
[model, isTotalsAvailable, totalsConfig]
);
useOnChange(
function updatePendingRowCount() {
Expand Down

0 comments on commit bb7c663

Please sign in to comment.