lbry-desktop/ui/component/syncPassword/index.js

23 lines
963 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2020-10-02 17:03:25 +02:00
import { selectGetSyncIsPending, selectSyncApplyPasswordError } from 'redux/selectors/sync';
import { doGetSyncDesktop } from 'redux/actions/sync';
import { selectUserEmail } from 'redux/selectors/user';
import { doSetClientSetting } from 'redux/actions/settings';
import { doSignOut, doHandleSyncComplete } from 'redux/actions/app';
import SyncPassword from './view';
const select = state => ({
getSyncIsPending: selectGetSyncIsPending(state),
email: selectUserEmail(state),
passwordError: selectSyncApplyPasswordError(state),
});
const perform = dispatch => ({
2020-09-04 17:02:30 +02:00
getSync: (cb, password) => dispatch(doGetSyncDesktop(cb, password)),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
handleSyncComplete: (error, hasDataChanged) => dispatch(doHandleSyncComplete(error, hasDataChanged)),
2019-10-28 15:04:37 +01:00
signOut: () => dispatch(doSignOut()),
});
export default connect(select, perform)(SyncPassword);