1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-30 20:28:09 +00:00

close modal on DEVICE.CONNECT action

This commit is contained in:
Szymon Lesisz 2018-10-11 13:07:58 +02:00
parent 337eacd1d2
commit 5eb5e3f774

View File

@ -52,6 +52,15 @@ export default function modal(state: State = initialState, action: Action): Stat
}
return state;
// device connected
// close modal if modal context is not 'device'
case DEVICE.CONNECT:
case DEVICE.CONNECT_UNACQUIRED:
if (state.context !== MODAL.CONTEXT_DEVICE) {
return initialState;
}
return state;
// device with context assigned to modal was disconnected
// close modal
case DEVICE.DISCONNECT: