Skip to content

Commit

Permalink
[Discover] fix manage of saved search embeddable columns
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaanj committed Sep 15, 2022
1 parent 0c8dd66 commit d00ae96
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class SavedSearchEmbeddable
this.searchProps &&
(titleChanged ||
this.isFetchRequired(this.searchProps) ||
this.isInputChangedAndRerenderRequired(this.searchProps))
this.rerenderRequired(this.searchProps))
) {
this.pushContainerStateParamsToProps(this.searchProps);
}
Expand Down Expand Up @@ -420,11 +420,14 @@ export class SavedSearchEmbeddable
);
}

private isInputChangedAndRerenderRequired(searchProps?: SearchProps) {
private rerenderRequired(searchProps?: SearchProps) {
if (!searchProps) {
return false;
}
return this.input.rowsPerPage !== searchProps.rowsPerPageState;
return (
this.input.rowsPerPage !== searchProps.rowsPerPageState ||
(this.input.columns && !isEqual(this.input.columns, searchProps.columns))
);
}

private async pushContainerStateParamsToProps(
Expand Down

0 comments on commit d00ae96

Please sign in to comment.