mirror of
https://github.com/usememos/memos.git
synced 2024-12-20 09:41:58 +03:00
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:
parent
c27c6cea13
commit
c14c6b3786
@ -21,8 +21,15 @@ const defaultLocalSetting: LocalSetting = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const convertResponseModelUser = (user: User): User => {
|
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 = {
|
const setting: Setting = {
|
||||||
...defaultSetting,
|
...defaultSetting,
|
||||||
|
...systemSetting,
|
||||||
};
|
};
|
||||||
const { localSetting: storageLocalSetting } = storage.get(["localSetting"]);
|
const { localSetting: storageLocalSetting } = storage.get(["localSetting"]);
|
||||||
const localSetting: LocalSetting = {
|
const localSetting: LocalSetting = {
|
||||||
|
4
web/src/types/modules/setting.d.ts
vendored
4
web/src/types/modules/setting.d.ts
vendored
@ -1,5 +1,9 @@
|
|||||||
type Appearance = "system" | "light" | "dark";
|
type Appearance = "system" | "light" | "dark";
|
||||||
|
|
||||||
|
interface BasicSetting {
|
||||||
|
locale: Locale;
|
||||||
|
appearance: Appearance;
|
||||||
|
}
|
||||||
interface Setting {
|
interface Setting {
|
||||||
locale: Locale;
|
locale: Locale;
|
||||||
appearance: Appearance;
|
appearance: Appearance;
|
||||||
|
Loading…
Reference in New Issue
Block a user