diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-05-27 05:32:45 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-05-27 05:32:45 +0800 |
commit | 5da6fd5ab18812929cbf790527a3029fd8d7123c (patch) | |
tree | a93ca3f0f32e715c9c5174dfe5e205239de59e9d /ui/app/reducers | |
parent | d31189b2066d0225eb57e86d077d579cf223658c (diff) | |
download | tangerine-wallet-browser-5da6fd5ab18812929cbf790527a3029fd8d7123c.tar tangerine-wallet-browser-5da6fd5ab18812929cbf790527a3029fd8d7123c.tar.gz tangerine-wallet-browser-5da6fd5ab18812929cbf790527a3029fd8d7123c.tar.bz2 tangerine-wallet-browser-5da6fd5ab18812929cbf790527a3029fd8d7123c.tar.lz tangerine-wallet-browser-5da6fd5ab18812929cbf790527a3029fd8d7123c.tar.xz tangerine-wallet-browser-5da6fd5ab18812929cbf790527a3029fd8d7123c.tar.zst tangerine-wallet-browser-5da6fd5ab18812929cbf790527a3029fd8d7123c.zip |
Add clicking txs in list shows tx conf screen
Diffstat (limited to 'ui/app/reducers')
-rw-r--r-- | ui/app/reducers/app.js | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index a98b809d6..08c2268c1 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -12,10 +12,10 @@ function reduceApp(state, action) { const pendingTxs = hasPendingTxs(state) let name = 'accounts' if (selectedAccount) { - defaultView = 'accountDetail' + name = 'accountDetail' } if (pendingTxs) { - defaultView = 'confTx' + name = 'confTx' } var defaultView = { @@ -270,6 +270,17 @@ function reduceApp(state, action) { } }) + case actions.VIEW_PENDING_TX: + const context = indexForPending(state, action.value) + return extend(appState, { + transForward: true, + currentView: { + name: 'confTx', + context, + warning: null, + } + }) + case actions.PREVIOUS_TX: return extend(appState, { transForward: false, @@ -366,3 +377,16 @@ function hasPendingTxs (state) { var unconfTxList = txHelper(unconfTxs, unconfMsgs) return unconfTxList.length > 0 } + +function indexForPending(state, txId) { + var unconfTxs = state.metamask.unconfTxs + var unconfMsgs = state.metamask.unconfMsgs + var unconfTxList = txHelper(unconfTxs, unconfMsgs) + let idx + unconfTxList.forEach((tx, i) => { + if (tx.id === txId) { + idx = i + } + }) + return idx +} |