From 1700a708cfe3c44bc64a01b17cc104f3425956d2 Mon Sep 17 00:00:00 2001 From: hamed musallam Date: Tue, 15 Oct 2024 12:00:58 +0200 Subject: [PATCH] fix: reset domain when cancel filter in live preview --- src/component/reducer/actions/FiltersActions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/component/reducer/actions/FiltersActions.ts b/src/component/reducer/actions/FiltersActions.ts index 59f4b8a2e..976304247 100644 --- a/src/component/reducer/actions/FiltersActions.ts +++ b/src/component/reducer/actions/FiltersActions.ts @@ -326,12 +326,15 @@ function rollbackSpectrumByFilter( draft.toolOptions.data.activeFilterID = null; draft.tempData = null; - if (datum.filters.length > 0 && filterIndex !== -1) { + if (filterIndex !== -1 && datum.filters.length > 0) { updateDomainOptions = getFilterDomain(datum, { startIndex: filterIndex, lastIndex: datum.filters.length - 1, }); + } else { + updateDomainOptions = { updateXDomain: true, updateYDomain: true }; } + const { toolOptions: { data }, } = getInitialState();