From 31aadf7d388ccbae9ebb5fb1f20f25a50b6ea95b Mon Sep 17 00:00:00 2001 From: Gayan Sandamal Date: Wed, 4 Sep 2024 10:19:58 +0530 Subject: [PATCH] Revert to the "Label" set inside the node when passed null https://github.com/FlowFuse/node-red-dashboard/pull/1238#issuecomment-2326501480 --- ui/src/main.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/src/main.mjs b/ui/src/main.mjs index ba59146a8..b16a91b55 100644 --- a/ui/src/main.mjs +++ b/ui/src/main.mjs @@ -232,8 +232,10 @@ fetch('_setup') getProperty (property) { const config = this.props ? this.props[property] : null // last known value for the config of this widget property const state = this.state[property] // chec if there have been any dynamic updates to this property + // check if the state is null or a string 'null' + const isNull = typeof state === 'string' ? state === 'null' : state === null // return the dynamic property if it exists, otherwise return the last known configuration - return this.state && property in this.state && state !== null ? state : config + return this.state && property in this.state && !isNull ? state : config } } })