From d6a2801d49570e6a989909abeb490ce30972a3f5 Mon Sep 17 00:00:00 2001 From: f0x Date: Fri, 16 Sep 2022 21:01:58 +0200 Subject: [PATCH] fix user settings redux keys --- web/source/settings-panel/components/form-fields.jsx | 3 +-- web/source/settings-panel/lib/api/user.js | 1 - web/source/settings-panel/redux/reducers/user.js | 3 +++ web/source/settings-panel/user/settings.js | 10 +++++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/web/source/settings-panel/components/form-fields.jsx b/web/source/settings-panel/components/form-fields.jsx index 0ecaa2dc4..cb402c3b2 100644 --- a/web/source/settings-panel/components/form-fields.jsx +++ b/web/source/settings-panel/components/form-fields.jsx @@ -134,8 +134,7 @@ module.exports = { let label = ; return (
- {defaultLabel ? label : null} - {field} + {defaultLabel ? label : null} {field} {children}
); diff --git a/web/source/settings-panel/lib/api/user.js b/web/source/settings-panel/lib/api/user.js index a2967c449..18b54bd73 100644 --- a/web/source/settings-panel/lib/api/user.js +++ b/web/source/settings-panel/lib/api/user.js @@ -19,7 +19,6 @@ "use strict"; const Promise = require("bluebird"); -const d = require("dotty"); const user = require("../../redux/reducers/user").actions; diff --git a/web/source/settings-panel/redux/reducers/user.js b/web/source/settings-panel/redux/reducers/user.js index 673ed33d9..5db312d34 100644 --- a/web/source/settings-panel/redux/reducers/user.js +++ b/web/source/settings-panel/redux/reducers/user.js @@ -29,6 +29,9 @@ module.exports = createSlice({ }, reducers: { setAccount: (state, {payload}) => { + if (payload.source != undefined && payload.source.language != undefined) { + payload.source.language = payload.source.language.toUpperCase(); + } state.profile = payload; // /user/settings only needs a copy of the 'source' obj state.settings = { diff --git a/web/source/settings-panel/user/settings.js b/web/source/settings-panel/user/settings.js index 47d1a41d7..80cd9e8b9 100644 --- a/web/source/settings-panel/user/settings.js +++ b/web/source/settings-panel/user/settings.js @@ -32,7 +32,7 @@ const Submit = require("../components/submit"); const { Checkbox, Select, -} = require("../components/form-fields").formFields(user.setProfileVal, (state) => state.user.profile); +} = require("../components/form-fields").formFields(user.setSettingsVal, (state) => state.user.settings); module.exports = function UserSettings() { const dispatch = Redux.useDispatch(); @@ -49,11 +49,11 @@ module.exports = function UserSettings() { <>

Post settings

- - -