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

fix: user default 'Basic Setting' should follow system setting
This commit is contained in:
2023-06-07 00:38:50 +08:00 committed by GitHub
parent c27c6cea13
commit c14c6b3786
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -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 = {

View file

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