Use lodash get

This commit is contained in:
Chi Vinh Le
2018-05-11 20:46:32 +02:00
parent f0dcd844a7
commit 7d8d5a6115
@@ -5,6 +5,7 @@ import AddEmailAddressDialog from '../components/AddEmailAddressDialog';
import { notify } from 'coral-framework/actions/notification';
import { withAttachLocalAuth } from '../hocs';
import { startAttach, finishAttach } from '../actions';
import get from 'lodash/get';
const mapStateToProps = ({ talkPluginLocalAuth: state }) => ({
inProgress: state.inProgress,
@@ -41,7 +42,7 @@ export default compose(
excludeIf(
({ root: { me }, inProgress }) =>
!me ||
me.state.status.username.status === 'UNSET' ||
get(me, 'state.status.username.status') === 'UNSET' ||
(me.email && !inProgress)
)
)(AddEmailAddressDialog);