fix: user default 'Basic Setting' should follow server's setting (#1795)

fix: user default 'Basic Setting' should follow system setting
pull/1812/head
2 years ago committed by GitHub
parent c27c6cea13
commit c14c6b3786
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,8 +21,15 @@ const defaultLocalSetting: LocalSetting = {
};
export const convertResponseModelUser = (user: User): User => {
// user default 'Basic Setting' should follow server's setting
// 'Basic Setting' fields: locale, appearance
const { systemStatus } = store.getState().global;
const { locale, appearance } = systemStatus.customizedProfile;
const systemSetting = { locale, appearance };
const setting: Setting = {
...defaultSetting,
...systemSetting,
};
const { localSetting: storageLocalSetting } = storage.get(["localSetting"]);
const localSetting: LocalSetting = {

@ -1,5 +1,9 @@
type Appearance = "system" | "light" | "dark";
interface BasicSetting {
locale: Locale;
appearance: Appearance;
}
interface Setting {
locale: Locale;
appearance: Appearance;

Loading…
Cancel
Save