From 165d3b6b337fefb1ecba64865ef2f590eb37107a Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Thu, 16 Mar 2023 16:19:02 +0300 Subject: [PATCH] Fix setting up entity background Signed-off-by: Alex Andreev --- .../core/src/main/cluster/update-entity-spec.injectable.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/src/main/cluster/update-entity-spec.injectable.ts b/packages/core/src/main/cluster/update-entity-spec.injectable.ts index 419359ba4b..bdb8a1491a 100644 --- a/packages/core/src/main/cluster/update-entity-spec.injectable.ts +++ b/packages/core/src/main/cluster/update-entity-spec.injectable.ts @@ -23,8 +23,13 @@ const updateEntitySpecInjectable = getInjectable({ entity.spec.metrics.prometheus = prometheus; } + entity.spec.icon ??= {}; + + if (cluster.preferences.iconBackgroundColor) { + entity.spec.icon.background = cluster.preferences.iconBackgroundColor; + } + if (cluster.preferences.icon) { - entity.spec.icon ??= {}; entity.spec.icon.src = cluster.preferences.icon; entity.spec.icon.background = cluster.preferences.iconBackgroundColor; } else if (cluster.preferences.icon === null) {