From 77a08e7c61ec2743241c9d0bb6da453ea19a5eb4 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Mon, 15 Jun 2020 16:59:34 +0300 Subject: [PATCH] Fixed not correct call custom parseValueFunction in RPC widget --- .../home/components/widget/lib/rpc/led-indicator.component.ts | 2 +- .../home/components/widget/lib/rpc/round-switch.component.ts | 2 +- .../modules/home/components/widget/lib/rpc/switch.component.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.ts index 847987c215..efdf87bc6b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.ts @@ -320,7 +320,7 @@ export class LedIndicatorComponent extends PageComponent implements OnInit, OnDe const keyData = data[0]; if (keyData && keyData.data && keyData.data[0]) { const attrValue = keyData.data[0][1]; - if (attrValue) { + if (isDefined(attrValue)) { let parsed = null; try { parsed = this.parseValueFunction(JSON.parse(attrValue)); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.ts index fe6b8cbeb6..a8ed46e529 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.ts @@ -315,7 +315,7 @@ export class RoundSwitchComponent extends PageComponent implements OnInit, OnDes const keyData = data[0]; if (keyData && keyData.data && keyData.data[0]) { const attrValue = keyData.data[0][1]; - if (attrValue) { + if (isDefined(attrValue)) { let parsed = null; try { parsed = this.parseValueFunction(JSON.parse(attrValue)); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.ts index 2fe2404b95..f4a84d0326 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.ts @@ -333,7 +333,7 @@ export class SwitchComponent extends PageComponent implements OnInit, OnDestroy const keyData = data[0]; if (keyData && keyData.data && keyData.data[0]) { const attrValue = keyData.data[0][1]; - if (attrValue) { + if (isDefined(attrValue)) { let parsed = null; try { parsed = this.parseValueFunction(JSON.parse(attrValue));