2019-09-26 18:28:08 +02:00
|
|
|
import { connect } from 'react-redux';
|
2019-10-29 20:26:03 +01:00
|
|
|
import { doGetSync, selectGetSyncIsPending, selectUserEmail, selectSyncApplyPasswordError } from 'lbryinc';
|
2019-09-26 18:28:08 +02:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2019-10-28 15:04:37 +01:00
|
|
|
import { doSignOut } from 'redux/actions/app';
|
2019-09-26 18:28:08 +02:00
|
|
|
import SyncPassword from './view';
|
|
|
|
|
|
|
|
const select = state => ({
|
|
|
|
getSyncIsPending: selectGetSyncIsPending(state),
|
2019-10-24 17:48:58 +02:00
|
|
|
email: selectUserEmail(state),
|
2019-10-29 20:26:03 +01:00
|
|
|
passwordError: selectSyncApplyPasswordError(state),
|
2019-09-26 18:28:08 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2020-01-03 21:43:49 +01:00
|
|
|
getSync: (password, cb) => dispatch(doGetSync(password, cb)),
|
2019-09-26 18:28:08 +02:00
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
2019-10-28 15:04:37 +01:00
|
|
|
signOut: () => dispatch(doSignOut()),
|
2019-09-26 18:28:08 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(SyncPassword);
|