Loëck Vézien
7 years ago
No known key found for this signature in database
GPG Key ID: CBCDCE384E853AC4
3 changed files with
15 additions and
1 deletions
-
src/components/modals/AddAccount/index.js
-
src/internals/usb/wallet/accounts.js
-
src/internals/usb/wallet/index.js
|
|
@ -134,6 +134,19 @@ class AddAccountModal extends PureComponent<Props, State> { |
|
|
|
ipcRenderer.on('msg', this.handleWalletRequest) |
|
|
|
} |
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps) { |
|
|
|
if (nextProps.accounts) { |
|
|
|
this.setState(prev => ({ |
|
|
|
accounts: Object.keys(prev.accounts).reduce((result, value) => { |
|
|
|
if (!nextProps.accounts[value]) { |
|
|
|
result[value] = prev.accounts[value] |
|
|
|
} |
|
|
|
return result |
|
|
|
}, {}), |
|
|
|
})) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
componentDidUpdate() { |
|
|
|
const { step } = this.state |
|
|
|
const { currentDevice } = this.props |
|
|
|
|
|
@ -122,7 +122,7 @@ export default async ({ |
|
|
|
|
|
|
|
const hasTransactions = account.transactions.length > 0 |
|
|
|
|
|
|
|
accounts[currentAccount] = { |
|
|
|
accounts[xpub58] = { |
|
|
|
id: xpub58, |
|
|
|
...account, |
|
|
|
} |
|
|
|
|
|
@ -31,6 +31,7 @@ export default (sendEvent: Function) => ({ |
|
|
|
currentAccounts, |
|
|
|
onProgress: progress => sendEvent('wallet.getAccounts.progress', progress, { kill: false }), |
|
|
|
}) |
|
|
|
|
|
|
|
sendEvent('wallet.getAccounts.success', data) |
|
|
|
} catch (err) { |
|
|
|
sendEvent('wallet.getAccounts.fail', err.stack || err) |
|
|
|