Skip to content

Commit

Permalink
Send NULL state as 'null' when requesting icons
Browse files Browse the repository at this point in the history
BasicUI set a predecent for doing so, and users are relying on that
behavior.

Fixes #3461

Signed-off-by: Danny Baumann <[email protected]>
  • Loading branch information
maniac103 committed Aug 31, 2023
1 parent 9dfa34f commit 84026b7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ internal fun String?.toOH2WidgetIconResource(

val stateToUse = state ?: item?.state
val iconState = when {
stateToUse == null || !useState || item == null -> null
!useState || item == null -> null
// For NULL states, we send 'null' as state when fetching the icon (BasicUI set a predecent for doing so)
stateToUse == null -> "null"
// Number items need to use state formatted as per their state description
item.isOfTypeOrGroupType(Item.Type.Number) || item.isOfTypeOrGroupType(Item.Type.NumberWithDimension)-> {
stateToUse.asNumber.toString()
Expand Down

0 comments on commit 84026b7

Please sign in to comment.