lbry-desktop/ui/component/settingUnauthenticated/index.js
infinite-persistence aba9198844
Handle unauthenticated case, i.e. only allow basic settings.
Placed settings that we allow for unauthenticated users under <SettingUnauthenticated>. While it is redundant, it's easier to handle the grouping, and more readable overall.
2021-08-23 23:45:21 +08:00

16 lines
572 B
JavaScript

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