2018-03-23 00:03:05 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { SETTINGS } from 'lbry-redux';
|
|
|
|
import { doSetClientSetting } from '../../redux/actions/settings';
|
|
|
|
import { makeSelectClientSetting } from '../../redux/selectors/settings';
|
|
|
|
import SettingsPage from './view';
|
|
|
|
|
|
|
|
const select = state => ({
|
2018-04-23 11:26:09 +02:00
|
|
|
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
|
2018-03-23 00:03:05 +01:00
|
|
|
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
|
|
|
|
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state),
|
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(SettingsPage);
|