From 5e1a0cbc8de48c2cc3e57fe01abcfa7cdcd01afd Mon Sep 17 00:00:00 2001 From: dromerolovo Date: Thu, 6 Jun 2024 14:25:08 -0500 Subject: [PATCH] fix: theme not being updated --- .../components/share/chatbot/theme/theme-context.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/app/components/share/chatbot/theme/theme-context.ts b/web/app/components/share/chatbot/theme/theme-context.ts index a18a47f6ac2834..0f7cfa41b1a2f4 100644 --- a/web/app/components/share/chatbot/theme/theme-context.ts +++ b/web/app/components/share/chatbot/theme/theme-context.ts @@ -2,8 +2,8 @@ import { createContext, useContext } from 'use-context-selector' import { hexToRGBA } from './utils' export class Theme { - private chatColorTheme: string | null - private chatColorThemeInverted: boolean + public chatColorTheme: string | null + public chatColorThemeInverted: boolean public primaryColor = '#1C64F2' public backgroundHeaderColorStyle = 'backgroundImage: linear-gradient(to right, #2563eb, #0ea5e9)' @@ -52,6 +52,12 @@ export class ThemeBuilder { this.theme = new Theme(chatColorTheme, chatColorThemeInverted) this.buildChecker = true } + else { + if (this.theme?.chatColorTheme !== chatColorTheme || this.theme?.chatColorThemeInverted !== chatColorThemeInverted) { + this.theme = new Theme(chatColorTheme, chatColorThemeInverted) + this.buildChecker = true + } + } } }