From 0a42624ba46e45a04d52417586d12337186d949c Mon Sep 17 00:00:00 2001 From: mpetrov Date: Thu, 1 Aug 2024 12:49:07 +0300 Subject: [PATCH] Revert "refactoring" This reverts commit c2c54e5104d4f414721915e1931095cf1bed9887. --- .../modbus-slave-config.component.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/modbus/modbus-slave-config/modbus-slave-config.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/modbus/modbus-slave-config/modbus-slave-config.component.ts index bf1acfbf94..86b601de53 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/modbus/modbus-slave-config/modbus-slave-config.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/modbus/modbus-slave-config/modbus-slave-config.component.ts @@ -127,8 +127,8 @@ export class ModbusSlaveConfigComponent implements ControlValueAccessor, Validat this.observeValueChanges(); this.observeTypeChange(); - this.observeFormEnable(); this.observeShowSecurity(); + this.observeFormEnable(); } get protocolType(): ModbusProtocolType { @@ -173,15 +173,6 @@ export class ModbusSlaveConfigComponent implements ControlValueAccessor, Validat }); } - private observeTypeChange(): void { - this.slaveConfigFormGroup.get('type').valueChanges - .pipe(takeUntil(this.destroy$)) - .subscribe(type => { - this.updateFormEnableState(this.enableSlaveControl.value); - this.updateMethodType(type); - }); - } - private observeFormEnable(): void { this.enableSlaveControl.valueChanges .pipe(takeUntil(this.destroy$)) @@ -191,6 +182,15 @@ export class ModbusSlaveConfigComponent implements ControlValueAccessor, Validat }); } + private observeTypeChange(): void { + this.slaveConfigFormGroup.get('type').valueChanges + .pipe(takeUntil(this.destroy$)) + .subscribe(type => { + this.updateFormEnableState(this.enableSlaveControl.value); + this.updateMethodType(type); + }); + } + private updateMethodType(type: ModbusProtocolType): void { if (this.slaveConfigFormGroup.get('method').value !== ModbusMethodType.RTU) { this.slaveConfigFormGroup.get('method').patchValue(