From b860f84bb1409bd7bc284d02c6aba4184fe61efd Mon Sep 17 00:00:00 2001 From: hamed musallam Date: Fri, 22 Nov 2024 10:04:37 +0100 Subject: [PATCH] fix: update domain in 2D --- .../reducer/actions/FiltersActions.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/component/reducer/actions/FiltersActions.ts b/src/component/reducer/actions/FiltersActions.ts index d58d10b9a..f1318d320 100644 --- a/src/component/reducer/actions/FiltersActions.ts +++ b/src/component/reducer/actions/FiltersActions.ts @@ -210,17 +210,20 @@ export type FiltersActions = | 'APPLY_AUTO_PHASE_CORRECTION_TOW_DIMENSION_FILTER' >; +const DEFAULT_FILTER_DOMAIN_UPDATE_RULES: FilterDomainUpdateRules = { + updateXDomain: false, + updateYDomain: false, +}; + function getFilterUpdateDomainRules( filterName: string, - defaultRule?: FilterDomainUpdateRules, + defaultRule: FilterDomainUpdateRules = DEFAULT_FILTER_DOMAIN_UPDATE_RULES, ) { - return ( - Filters1D[filterName]?.domainUpdateRules || - defaultRule || { - updateXDomain: false, - updateYDomain: false, - } - ); + const filterDomainUpdateRules = + Filters1D?.[filterName]?.domainUpdateRules ?? + Filters2D?.[filterName]?.domainUpdateRules; + + return filterDomainUpdateRules || defaultRule; } export interface RollbackSpectrumByFilterOptions {