2019-10-15 23:23:51 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
|
|
|
import { connect } from 'react-redux';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
|
|
import { selectGetSyncErrorMessage } from 'lbryinc';
|
2019-10-15 23:23:51 +02:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
|
|
|
import SyncToggle from './view';
|
|
|
|
|
|
|
|
const select = state => ({
|
|
|
|
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
|
|
|
|
verifiedEmail: selectUserVerifiedEmail(state),
|
2019-10-16 07:01:18 +02:00
|
|
|
getSyncError: selectGetSyncErrorMessage(state),
|
2019-10-15 23:23:51 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
setSyncEnabled: value => dispatch(doSetClientSetting(SETTINGS.ENABLE_SYNC, value)),
|
|
|
|
});
|
|
|
|
|
2020-06-15 22:33:03 +02:00
|
|
|
export default connect(select, perform)(SyncToggle);
|