diff --git a/src/components/IsUnlocked/index.js b/src/components/IsUnlocked/index.js index f1f9b429..12ddc0fd 100644 --- a/src/components/IsUnlocked/index.js +++ b/src/components/IsUnlocked/index.js @@ -57,6 +57,12 @@ class IsUnlocked extends PureComponent { ...defaultState, } + componentWillMount() { + if (this.props.isLocked) { + stopSyncAccounts() + } + } + componentWillReceiveProps(nextProps) { if (this.props.isLocked && !nextProps.isLocked) { startSyncAccounts(nextProps.accounts) diff --git a/src/components/SelectAccount.js b/src/components/SelectAccount.js index e187f9aa..40e9a6c9 100644 --- a/src/components/SelectAccount.js +++ b/src/components/SelectAccount.js @@ -12,6 +12,10 @@ import Text from 'components/base/Text' import type { Account } from 'types/common' +function renderItem(accounts) { + return item => {(accounts.find(a => a.id === item) || {}).name} +} + const mapStateToProps: MapStateToProps<*, *, *> = state => ({ accounts: values(getAccounts(state)), }) @@ -24,12 +28,13 @@ type Props = { const SelectAccount = ({ accounts, value, onChange }: Props) => (