Skip to content

Commit

Permalink
fix(UI): celebration theme fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SimbiozizV committed Dec 9, 2024
1 parent 2c85e2c commit 67db4f4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/ui/src/ui/store/actions/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '../../../constants/index';
import {showToasterError, wrapApiPromiseByToaster} from '../../../utils/utils';
import {getSettingsCluster} from '../../selectors/global';
import {getSettingsDataFromInitialConfig} from '../../../config';

function logError(action: string, name: string) {
console.error('Failed to "%s" setting "%s", settings provider is disabled.', action, name);
Expand Down Expand Up @@ -131,6 +132,7 @@ export function reloadSetting(settingName: string, settingNS: SettingNS): Settin
};
}

const CELEBRATION_THEME_KEY = 'global::celebrationTheme';
export function reloadUserSettings(login: string): SettingsThunkAction {
return async (dispatch, getState) => {
try {
Expand All @@ -149,6 +151,13 @@ export function reloadUserSettings(login: string): SettingsThunkAction {
errorContent: 'Cannot load user settings',
})
: allData;
if (data[CELEBRATION_THEME_KEY] === undefined) {
const initialSettings = getSettingsDataFromInitialConfig();
const celebrationTheme = initialSettings.data[CELEBRATION_THEME_KEY];
if (celebrationTheme !== undefined) {
data[CELEBRATION_THEME_KEY] = celebrationTheme;
}
}
dispatch({type: UPDATE_SETTING_DATA, data});
} catch (e) {}
};
Expand Down

0 comments on commit 67db4f4

Please sign in to comment.