diff --git a/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts index f44becd2f1..972c0412cd 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts @@ -92,7 +92,7 @@ export class MqttDeviceProfileTransportConfigurationComponent implements Control }); let configurationFormGroup = this.mqttDeviceProfileTransportConfigurationFormGroup.controls.configuration as FormGroup; configurationFormGroup.get('transportPayloadType').valueChanges.subscribe(payloadType => { - this.onTransportPayloadTypeChanged(payloadType, configurationFormGroup); + this.updateTransportPayloadBasedControls(type, configurationFormGroup) this.mqttDeviceProfileTransportConfigurationFormGroup.updateValueAndValidity(); }); this.mqttDeviceProfileTransportConfigurationFormGroup.valueChanges.subscribe(() => { @@ -132,10 +132,6 @@ export class MqttDeviceProfileTransportConfigurationComponent implements Control this.propagateChange(configuration); } - private onTransportPayloadTypeChanged(type: MqttTransportPayloadType, configurationFormGroup: FormGroup) { - this.updateTransportPayloadBasedControls(type, configurationFormGroup) - } - private updateTransportPayloadBasedControls(type: MqttTransportPayloadType, configurationFormGroup: FormGroup) { if (type === MqttTransportPayloadType.PROTOBUF) { configurationFormGroup.registerControl('deviceTelemetryProtoSchema', this.fb.control(null, Validators.required));