3b23f09bed
remove previous changes,keep syncpref in wallet, change anon wallet pref key to local sync choices wip dont relocate syncenable setting bump no prefs on web unauth bugfix redux bump pull after sync change bump
34 lines
1.2 KiB
JavaScript
34 lines
1.2 KiB
JavaScript
import { SETTINGS } from 'lbry-redux';
|
|
import { connect } from 'react-redux';
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
import {
|
|
selectGetSyncErrorMessage,
|
|
selectHasSyncedWallet,
|
|
selectGetSyncIsPending,
|
|
selectHashChanged,
|
|
doCheckSync,
|
|
doGetSync,
|
|
} from 'lbryinc';
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
|
import { doSetWalletSyncPreference } from 'redux/actions/settings';
|
|
import SyncToggle from './view';
|
|
import { doGetAndPopulatePreferences } from 'redux/actions/app';
|
|
|
|
const select = state => ({
|
|
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
|
|
hasSyncedWallet: selectHasSyncedWallet(state),
|
|
hasSyncChanged: selectHashChanged(state),
|
|
verifiedEmail: selectUserVerifiedEmail(state),
|
|
getSyncError: selectGetSyncErrorMessage(state),
|
|
getSyncPending: selectGetSyncIsPending(state),
|
|
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
|
});
|
|
|
|
const perform = dispatch => ({
|
|
setSyncEnabled: value => dispatch(doSetWalletSyncPreference(value)),
|
|
checkSync: () => dispatch(doCheckSync()),
|
|
getSync: (pw, cb) => dispatch(doGetSync(pw, cb)),
|
|
updatePreferences: () => dispatch(doGetAndPopulatePreferences()),
|
|
});
|
|
|
|
export default connect(select, perform)(SyncToggle);
|