lbry-desktop/ui/component/syncToggle/index.js
infinite-persistence 3c4ccdd2fe
Kill makeSelectClientSetting
## Why
- No memo required (no transformation).
- `makeSelect*` is an incorrect pattern.

## Changes
- Replaced makeSelectClientSetting with selectClientSetting.
- Remove unused selectShowRepostedContent.
2021-11-23 12:29:53 +08:00

22 lines
907 B
JavaScript

import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectGetSyncErrorMessage } from 'redux/selectors/sync';
import { selectClientSetting, selectLanguage } from 'redux/selectors/settings';
import { doSetWalletSyncPreference } from 'redux/actions/settings';
import { doOpenModal } from 'redux/actions/app';
import SyncToggle from './view';
const select = (state) => ({
syncEnabled: selectClientSetting(state, SETTINGS.ENABLE_SYNC),
verifiedEmail: selectUserVerifiedEmail(state),
getSyncError: selectGetSyncErrorMessage(state),
language: selectLanguage(state),
});
const perform = (dispatch) => ({
setSyncEnabled: (value) => dispatch(doSetWalletSyncPreference(value)),
openModal: (id, props) => dispatch(doOpenModal(id, props)),
});
export default connect(select, perform)(SyncToggle);