From 67db4f41aaa7e84449a88cdeff96f78361b0c88b Mon Sep 17 00:00:00 2001 From: simbiozizv Date: Mon, 9 Dec 2024 11:47:14 +0300 Subject: [PATCH] fix(UI): celebration theme fix --- packages/ui/src/ui/store/actions/settings/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/ui/src/ui/store/actions/settings/index.ts b/packages/ui/src/ui/store/actions/settings/index.ts index 38ef1ef81..40a7903b3 100644 --- a/packages/ui/src/ui/store/actions/settings/index.ts +++ b/packages/ui/src/ui/store/actions/settings/index.ts @@ -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); @@ -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 { @@ -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) {} };