Skip to content

Commit

Permalink
fix: reset domain when cancel filter in live preview
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Oct 15, 2024
1 parent 5fa9fd1 commit bb8e8f7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/component/reducer/actions/FiltersActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,17 @@ function rollbackSpectrumByFilter(
draft.toolOptions.data.activeFilterID = null;
draft.tempData = null;

if (datum.filters.length > 0 && filterIndex !== -1) {
updateDomainOptions = getFilterDomain(datum, {
startIndex: filterIndex,
lastIndex: datum.filters.length - 1,
});
if (filterIndex !== -1) {
if (datum.filters.length > 0) {
updateDomainOptions = getFilterDomain(datum, {
startIndex: filterIndex,
lastIndex: datum.filters.length - 1,
});
}
} else {
updateDomainOptions = { updateXDomain: true, updateYDomain: true };
}

const {
toolOptions: { data },
} = getInitialState();
Expand Down

0 comments on commit bb8e8f7

Please sign in to comment.