From 120c22775319b5434f451ed5303844d12e9584b2 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Mon, 26 Nov 2018 10:25:47 +0100 Subject: [PATCH] RecevieActions: with ripple call --- src/actions/ReceiveActions.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/actions/ReceiveActions.js b/src/actions/ReceiveActions.js index 95d56119..a039db9e 100644 --- a/src/actions/ReceiveActions.js +++ b/src/actions/ReceiveActions.js @@ -50,7 +50,9 @@ export const showUnverifiedAddress = (): Action => ({ //export const showAddress = (address_n: string): AsyncAction => { export const showAddress = (path: Array): AsyncAction => async (dispatch: Dispatch, getState: GetState): Promise => { const selected = getState().wallet.selectedDevice; - if (!selected) return; + const { network } = getState().selectedAccount; + + if (!selected || !network) return; if (selected && (!selected.connected || !selected.available)) { dispatch({ @@ -60,16 +62,22 @@ export const showAddress = (path: Array): AsyncAction => async (dispatch return; } - const response = await TrezorConnect.ethereumGetAddress({ + const params = { device: { path: selected.path, instance: selected.instance, state: selected.state, }, path, - // useEmptyPassphrase: !selected.instance, useEmptyPassphrase: selected.useEmptyPassphrase, - }); + }; + + let response; + if (network.type === 'ethereum') { + response = await TrezorConnect.ethereumGetAddress(params); + } else { + response = await TrezorConnect.rippleGetAddress(params); + } if (response && response.success) { dispatch({