use of com.haulmont.cuba.client.ClientUserSession in project cuba by cuba-platform.
the class AppUI method updateUiTheme.
protected void updateUiTheme() {
UserSession userSession = userSessionSource.getUserSession();
if (userSession instanceof ClientUserSession && ((ClientUserSession) userSession).isAuthenticated()) {
// load theme from user settings
String themeName = userSettingsTools.loadAppWindowTheme();
if (!Objects.equals(themeName, getTheme())) {
// check theme support
Set<String> supportedThemes = themeConstantsRepository.getAvailableThemes();
if (supportedThemes.contains(themeName)) {
app.applyTheme(themeName);
setTheme(themeName);
}
}
}
}
Aggregations