Auth: Reload CSS if mode change

This commit is contained in:
Sukhwinder Dhillon 2021-06-18 12:36:24 +02:00 committed by Johannes Meyer
parent 4ba0fb102f
commit 492a9ec229
1 changed files with 2 additions and 1 deletions

View File

@ -104,9 +104,10 @@ class Auth
// Reload CSS if the theme changed
$themingConfig = Icinga::app()->getConfig()->getSection('themes');
$userTheme = $user->getPreferences()->getValue('icingaweb', 'theme');
$themeMode = $user->getPreferences()->getValue('icingaweb', 'theme_mode');
if (! (bool) $themingConfig->get('disabled', false) && $userTheme !== null) {
$defaultTheme = $themingConfig->get('default', StyleSheet::DEFAULT_THEME);
if ($userTheme !== $defaultTheme) {
if (($userTheme !== $defaultTheme) || ($themeMode !== StyleSheet::DEFAULT_MODE)) {
$this->getResponse()->setReloadCss(true);
}
}