0f1d4039a9
- selectMyChannelClaims depends on `byId`, which currently is always invalidated per update, so it is not memoized. - Most of the use-cases just needs the ID or the length of the array anyways, so avoid generating a Claim array (in selectMyChannelClaims) unnecessarily -- the client need to reduce it back down to IDs again :/ - The simpler boolean also removes the need to memoize the selector, which saves a bit of memory.
22 lines
780 B
JavaScript
22 lines
780 B
JavaScript
import { connect } from 'react-redux';
|
|
import { selectHasChannels } from 'redux/selectors/claims';
|
|
import { selectWalletIsEncrypted } from 'redux/selectors/wallet';
|
|
import { doWalletStatus } from 'redux/actions/wallet';
|
|
import { selectUser, selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
import { selectLanguage } from 'redux/selectors/settings';
|
|
|
|
import SettingAccount from './view';
|
|
|
|
const select = (state) => ({
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
|
walletEncrypted: selectWalletIsEncrypted(state),
|
|
user: selectUser(state),
|
|
hasChannels: selectHasChannels(state),
|
|
language: selectLanguage(state),
|
|
});
|
|
|
|
const perform = (dispatch) => ({
|
|
doWalletStatus: () => dispatch(doWalletStatus()),
|
|
});
|
|
|
|
export default connect(select, perform)(SettingAccount);
|