Fix language-change not applied to all components immediately.
## Fixes: 3641 Language switch does not take effect right away ## Assessment: Although `Card`s in the Settings Page are actually being re-rendered, the `actions` within them might not be getting the signal, depending on their props. ## Changes: (1) Pass the language variable to the `actions`'s props for items that are affected. (2) Make the Wunderbar listen to language-changes as well (the only component outside of Settings that would need an immediate update).
This commit is contained in:
parent
ed624a1b5d
commit
7839bbf2a1
4 changed files with 10 additions and 2 deletions
|
@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fix report page layout ([#4384](https://github.com/lbryio/lbry-desktop/pull/4384))
|
- Fix report page layout ([#4384](https://github.com/lbryio/lbry-desktop/pull/4384))
|
||||||
|
- Fix language-change not applied to components immediately _community pr!_ ([#4437](https://github.com/lbryio/lbry-desktop/pull/4437))
|
||||||
|
|
||||||
## [0.46.2] - [2020-06-10]
|
## [0.46.2] - [2020-06-10]
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@ import {
|
||||||
selectSearchValue,
|
selectSearchValue,
|
||||||
selectSearchSuggestions,
|
selectSearchSuggestions,
|
||||||
selectSearchBarFocused,
|
selectSearchBarFocused,
|
||||||
|
SETTINGS,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import { doToast } from 'redux/actions/notifications';
|
import { doToast } from 'redux/actions/notifications';
|
||||||
import analytics from 'analytics';
|
import analytics from 'analytics';
|
||||||
import Wunderbar from './view';
|
import Wunderbar from './view';
|
||||||
|
@ -17,6 +19,7 @@ const select = state => ({
|
||||||
suggestions: selectSearchSuggestions(state),
|
suggestions: selectSearchSuggestions(state),
|
||||||
searchQuery: selectSearchValue(state),
|
searchQuery: selectSearchValue(state),
|
||||||
isFocused: selectSearchBarFocused(state),
|
isFocused: selectSearchBarFocused(state),
|
||||||
|
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = (dispatch, ownProps) => ({
|
const perform = (dispatch, ownProps) => ({
|
||||||
|
|
|
@ -46,6 +46,7 @@ const select = state => ({
|
||||||
darkModeTimes: makeSelectClientSetting(SETTINGS.DARK_MODE_TIMES)(state),
|
darkModeTimes: makeSelectClientSetting(SETTINGS.DARK_MODE_TIMES)(state),
|
||||||
ffmpegStatus: selectFfmpegStatus(state),
|
ffmpegStatus: selectFfmpegStatus(state),
|
||||||
findingFFmpeg: selectFindingFFmpeg(state),
|
findingFFmpeg: selectFindingFFmpeg(state),
|
||||||
|
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
|
|
@ -87,6 +87,7 @@ type Props = {
|
||||||
findingFFmpeg: boolean,
|
findingFFmpeg: boolean,
|
||||||
findFFmpeg: () => void,
|
findFFmpeg: () => void,
|
||||||
openModal: string => void,
|
openModal: string => void,
|
||||||
|
language?: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
|
@ -246,6 +247,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||||
clearCache,
|
clearCache,
|
||||||
findingFFmpeg,
|
findingFFmpeg,
|
||||||
openModal,
|
openModal,
|
||||||
|
language,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { storedPassword } = this.state;
|
const { storedPassword } = this.state;
|
||||||
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
|
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
|
||||||
|
@ -277,7 +279,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||||
? __("To enable this feature, check 'Save Password' the next time you start the app.")
|
? __("To enable this feature, check 'Save Password' the next time you start the app.")
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
actions={<SyncToggle disabled={walletEncrypted && !storedPassword} />}
|
actions={<SyncToggle language={language} disabled={walletEncrypted && !storedPassword} />}
|
||||||
/>
|
/>
|
||||||
<Card
|
<Card
|
||||||
title={__('Download Directory')}
|
title={__('Download Directory')}
|
||||||
|
@ -353,6 +355,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||||
|
|
||||||
{!disableMaxKeyFee && (
|
{!disableMaxKeyFee && (
|
||||||
<FormFieldPrice
|
<FormFieldPrice
|
||||||
|
language={language}
|
||||||
name="max_key_fee"
|
name="max_key_fee"
|
||||||
min={0}
|
min={0}
|
||||||
onChange={this.onKeyFeeChange}
|
onChange={this.onKeyFeeChange}
|
||||||
|
@ -791,7 +794,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||||
|
|
||||||
{/* @if TARGET='app' */}
|
{/* @if TARGET='app' */}
|
||||||
{/* Auto launch in a hidden state doesn't work on mac https://github.com/Teamwork/node-auto-launch/issues/81 */}
|
{/* Auto launch in a hidden state doesn't work on mac https://github.com/Teamwork/node-auto-launch/issues/81 */}
|
||||||
{!IS_MAC && <Card title={__('Startup Preferences')} actions={<SettingAutoLaunch />} />}
|
{!IS_MAC && <Card title={__('Startup Preferences')} actions={<SettingAutoLaunch language={language} />} />}
|
||||||
{/* @endif */}
|
{/* @endif */}
|
||||||
|
|
||||||
<Card
|
<Card
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue