1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-13 20:08:56 +00:00

open modal on UI.REQUEST_CONFIRMATION event

This commit is contained in:
Szymon Lesisz 2019-02-22 17:39:51 +01:00
parent 2fc0e88ee3
commit bc7a8401f8
2 changed files with 11 additions and 1 deletions

View File

@ -7,3 +7,4 @@ export const CONTEXT_DEVICE: 'modal_ctx_device' = 'modal_ctx_device';
export const CONTEXT_EXTERNAL_WALLET: 'modal_ctx_external-wallet' = 'modal_ctx_external-wallet';
export const OPEN_SCAN_QR: 'modal__open_scan_qr' = 'modal__open_scan_qr';
export const CONTEXT_SCAN_QR: 'modal__ctx_scan_qr' = 'modal__ctx_scan_qr';
export const CONTEXT_CONFIRMATION: 'modal__ctx_confirmation' = 'modal__ctx_confirmation';

View File

@ -20,7 +20,10 @@ export type State = {
windowType?: string;
} | {
context: typeof MODAL.CONTEXT_SCAN_QR,
}
} | {
context: typeof MODAL.CONTEXT_CONFIRMATION,
windowType: string;
};
const initialState: State = {
context: MODAL.CONTEXT_NONE,
@ -98,6 +101,12 @@ export default function modal(state: State = initialState, action: Action): Stat
context: MODAL.CONTEXT_SCAN_QR,
};
case UI.REQUEST_CONFIRMATION:
return {
context: MODAL.CONTEXT_CONFIRMATION,
windowType: action.payload.view,
};
default:
return state;
}