From a359d4a4b1b3fe7a3967341a72c4019e5e305f25 Mon Sep 17 00:00:00 2001 From: Dmitriymush Date: Thu, 4 Jan 2024 12:36:23 +0200 Subject: [PATCH] refactoring for ota package input --- .../ota-package/ota-package-autocomplete.component.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ui-ngx/src/app/shared/components/ota-package/ota-package-autocomplete.component.ts b/ui-ngx/src/app/shared/components/ota-package/ota-package-autocomplete.component.ts index 1de427901c..20610cd6d0 100644 --- a/ui-ngx/src/app/shared/components/ota-package/ota-package-autocomplete.component.ts +++ b/ui-ngx/src/app/shared/components/ota-package/ota-package-autocomplete.component.ts @@ -72,12 +72,11 @@ export class OtaPackageAutocompleteComponent implements ControlValueAccessor, On @Input() set deviceProfileId(value: string) { - this.deviceProfile = value; - const packageId = this.otaPackageFormGroup.get('packageId').value; - if (packageId && isNotEmptyStr(packageId)) { - this.reset(); - } else { - this.cleanFilteredPackages.next([]); + if (this.deviceProfile !== value) { + if (this.deviceProfile) { + this.reset(); + } + this.deviceProfile = value; } }