diff --git a/ui-ngx/src/app/shared/components/aggregation/aggregation-type-select.component.ts b/ui-ngx/src/app/shared/components/aggregation/aggregation-type-select.component.ts index 94426727c8..cca444773f 100644 --- a/ui-ngx/src/app/shared/components/aggregation/aggregation-type-select.component.ts +++ b/ui-ngx/src/app/shared/components/aggregation/aggregation-type-select.component.ts @@ -21,6 +21,7 @@ import { coerceBoolean } from '@shared/decorators/coercion'; import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field'; import { aggregationTranslations, AggregationType } from '@shared/models/time/time.models'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { isEqual } from '@core/utils'; @Component({ selector: 'tb-aggregation-type-select', @@ -108,7 +109,7 @@ export class AggregationTypeSelectComponent implements ControlValueAccessor, OnI } ngOnChanges({allowedAggregationTypes}: SimpleChanges): void { - if (!allowedAggregationTypes.firstChange && allowedAggregationTypes.currentValue !== allowedAggregationTypes.previousValue) { + if (!allowedAggregationTypes.firstChange && !isEqual(allowedAggregationTypes.currentValue, allowedAggregationTypes.previousValue)) { this.aggregationTypes = this.allowedAggregationTypes?.length ? this.allowedAggregationTypes : this.allAggregationTypes; const currentAggregationType: AggregationType = this.aggregationTypeFormGroup.get('aggregationType').value; if (currentAggregationType && !this.aggregationTypes.includes(currentAggregationType)) { diff --git a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts index c5b7dba0dc..5723cd7800 100644 --- a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts +++ b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts @@ -20,6 +20,7 @@ import { QuickTimeInterval, QuickTimeIntervalTranslationMap } from '@shared/mode import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field'; import { coerceBoolean } from '@shared/decorators/coercion'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { isEqual } from '@core/utils'; @Component({ selector: 'tb-quick-time-interval', @@ -90,7 +91,7 @@ export class QuickTimeIntervalComponent implements OnInit, ControlValueAccessor, } ngOnChanges({allowedIntervals}: SimpleChanges): void { - if (!allowedIntervals.firstChange && allowedIntervals.currentValue !== allowedIntervals.previousValue) { + if (!allowedIntervals.firstChange && !isEqual(allowedIntervals.currentValue, allowedIntervals.previousValue)) { this.intervals = this.allowedIntervals?.length ? this.allowedIntervals : this.allAvailableIntervals; const currentInterval: QuickTimeInterval = this.quickIntervalFormGroup.get('interval').value; if (currentInterval && !this.intervals.includes(currentInterval)) {