Skip to content

Commit

Permalink
fix: theme not being updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dromerolovo committed Jun 6, 2024
1 parent 6a731a4 commit 5e1a0cb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/app/components/share/chatbot/theme/theme-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand Down Expand Up @@ -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
}
}
}
}

Expand Down

0 comments on commit 5e1a0cb

Please sign in to comment.