From 1a3669ca76908b524275dff004a60a3f8f3077e3 Mon Sep 17 00:00:00 2001 From: infiinte-persistence Date: Mon, 6 Jul 2020 18:38:33 +0800 Subject: [PATCH] Patch for "7839bbf2: Fix language-change not applied to all components immediately" - Missed the "Account Password" card that is used for authenticated case. - For cards that are only used in Settings, listen to the language change in "select" instead of passing in as a prop. I think this is cleaner. --- ui/component/settingAccountPassword/index.js | 3 +++ ui/component/settingAutoLaunch/index.js | 1 + ui/component/syncToggle/index.js | 1 + ui/page/settings/view.jsx | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/component/settingAccountPassword/index.js b/ui/component/settingAccountPassword/index.js index fcc5ddd81..03eb8a813 100644 --- a/ui/component/settingAccountPassword/index.js +++ b/ui/component/settingAccountPassword/index.js @@ -1,13 +1,16 @@ import { connect } from 'react-redux'; import { selectUser, selectPasswordSetSuccess, selectPasswordSetError } from 'redux/selectors/user'; +import { makeSelectClientSetting } from 'redux/selectors/settings'; import { doUserPasswordSet, doClearPasswordEntry } from 'redux/actions/user'; import { doToast } from 'redux/actions/notifications'; import UserSignIn from './view'; +import * as SETTINGS from 'constants/settings'; const select = state => ({ user: selectUser(state), passwordSetSuccess: selectPasswordSetSuccess(state), passwordSetError: selectPasswordSetError(state), + language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state), }); export default connect(select, { diff --git a/ui/component/settingAutoLaunch/index.js b/ui/component/settingAutoLaunch/index.js index b8360f892..67dbb12f7 100644 --- a/ui/component/settingAutoLaunch/index.js +++ b/ui/component/settingAutoLaunch/index.js @@ -7,6 +7,7 @@ import SettingAutoLaunch from './view'; const select = state => ({ autoLaunch: makeSelectClientSetting(SETTINGS.AUTO_LAUNCH)(state), + language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state), }); const perform = dispatch => ({ diff --git a/ui/component/syncToggle/index.js b/ui/component/syncToggle/index.js index a7e3699f5..7899cf498 100644 --- a/ui/component/syncToggle/index.js +++ b/ui/component/syncToggle/index.js @@ -10,6 +10,7 @@ const select = state => ({ syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state), verifiedEmail: selectUserVerifiedEmail(state), getSyncError: selectGetSyncErrorMessage(state), + language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state), }); const perform = dispatch => ({ diff --git a/ui/page/settings/view.jsx b/ui/page/settings/view.jsx index 5159c18f7..c43f91101 100644 --- a/ui/page/settings/view.jsx +++ b/ui/page/settings/view.jsx @@ -279,7 +279,7 @@ class SettingsPage extends React.PureComponent { ? __("To enable this feature, check 'Save Password' the next time you start the app.") : null } - actions={} + actions={} /> { {/* @if TARGET='app' */} {/* Auto launch in a hidden state doesn't work on mac https://github.com/Teamwork/node-auto-launch/issues/81 */} - {!IS_MAC && } />} + {!IS_MAC && } />} {/* @endif */}