lbry-desktop/ui/component/settingUnauthenticated/index.js
infinite-persistence 6e152a4137
Re-render on language change
Room for improvement: refactor into `<SettingsCard>` so we don't have to repeat this everywhere.
2021-08-23 23:45:24 +08:00

17 lines
623 B
JavaScript

import { connect } from 'react-redux';
import { SETTINGS } from 'lbry-redux';
import { doSetClientSetting } from 'redux/actions/settings';
import { selectLanguage, makeSelectClientSetting } from 'redux/selectors/settings';
import SettingUnauthenticated from './view';
const select = (state) => ({
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
language: selectLanguage(state),
});
const perform = (dispatch) => ({
setSearchInLanguage: (value) => dispatch(doSetClientSetting(SETTINGS.SEARCH_IN_LANGUAGE, value)),
});
export default connect(select, perform)(SettingUnauthenticated);