1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

SelectedAccountActions fix

+ ignore ACCOUNT.DISPOSE action in "observe"
+ if discovery is interrupted display proper Account notification
This commit is contained in:
Szymon Lesisz 2018-10-04 10:51:06 +02:00
parent 4354e494c4
commit b4f6771544

View File

@ -74,7 +74,7 @@ const getAccountStatus = (state: State, selectedAccount: SelectedAccountState):
// account not found (yet). checking why... // account not found (yet). checking why...
if (!account) { if (!account) {
if (!discovery || discovery.waitingForDevice) { if (!discovery || (discovery.waitingForDevice || discovery.interrupted)) {
if (device.connected) { if (device.connected) {
// case 1: device is connected but discovery not started yet (probably waiting for auth) // case 1: device is connected but discovery not started yet (probably waiting for auth)
if (device.available) { if (device.available) {
@ -156,7 +156,7 @@ const actions = [
SEND.TX_COMPLETE, SEND.TX_COMPLETE,
WALLET.SET_SELECTED_DEVICE, WALLET.SET_SELECTED_DEVICE,
WALLET.UPDATE_SELECTED_DEVICE, WALLET.UPDATE_SELECTED_DEVICE,
...Object.values(ACCOUNT).filter(v => typeof v === 'string' && v !== ACCOUNT.UPDATE_SELECTED_ACCOUNT), // exported values got unwanted "__esModule: true" as first element ...Object.values(ACCOUNT).filter(v => typeof v === 'string' && v !== ACCOUNT.UPDATE_SELECTED_ACCOUNT && v !== ACCOUNT.DISPOSE), // exported values got unwanted "__esModule: true" as first element
...Object.values(DISCOVERY).filter(v => typeof v === 'string'), ...Object.values(DISCOVERY).filter(v => typeof v === 'string'),
...Object.values(TOKEN).filter(v => typeof v === 'string'), ...Object.values(TOKEN).filter(v => typeof v === 'string'),
...Object.values(PENDING).filter(v => typeof v === 'string'), ...Object.values(PENDING).filter(v => typeof v === 'string'),