From e9c5d815d98eb65b2c8104674c7c41746c737220 Mon Sep 17 00:00:00 2001 From: dudnikmaksim Date: Thu, 7 Dec 2023 17:23:48 +0200 Subject: [PATCH] default config --- .../widget/lib/gateway/gateway-connectors.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-connectors.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-connectors.component.ts index cd54221e32..6f1fc90f5e 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-connectors.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-connectors.component.ts @@ -140,7 +140,7 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie }); this.connectorForm.get('type').valueChanges.subscribe(type=> { - if(type && this.initialConnector === null) { + if(type && !this.initialConnector) { this.attributeService.getEntityAttributes(this.device, AttributeScope.CLIENT_SCOPE, [`${type.toUpperCase()}_DEFAULT_CONFIG`], {ignoreErrors: true}).subscribe(defaultConfig=>{ if (defaultConfig && defaultConfig.length) { @@ -322,6 +322,7 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie } private clearOutConnectorForm(): void { + this.initialConnector = null; this.connectorForm.setValue({ name: '', type: 'mqtt', @@ -331,7 +332,6 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie configuration: '', configurationJson: {} }); - this.initialConnector = null; this.connectorForm.markAsPristine(); }