Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

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

冇c14c6b3786ca
diff --git a/web/src/store/module/user.ts b/web/src/store/module/user.ts
index 29e392825..0e514add5 100644
--- a/web/src/store/module/user.ts
+++ b/web/src/store/module/user.ts
@@ -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 = {
diff --git a/web/src/types/modules/setting.d.ts b/web/src/types/modules/setting.d.ts
index 7a50662ac..1c5edcca9 100644
--- a/web/src/types/modules/setting.d.ts
+++ b/web/src/types/modules/setting.d.ts
@@ -1,5 +1,9 @@
type Appearance = "system" | "light" | "dark";
+interface BasicSetting {
+ locale: Locale;
+ appearance: Appearance;
+}
interface Setting {
locale: Locale;
appearance: Appearance;