Skip to content

Commit

Permalink
Revert to the "Label" set inside the node when passed null #1238 (com…
Browse files Browse the repository at this point in the history
  • Loading branch information
gayanSandamal committed Sep 4, 2024
1 parent b655d3e commit 31aadf7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/src/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
})
Expand Down

0 comments on commit 31aadf7

Please sign in to comment.