diff options
Diffstat (limited to 'ui/app/reducers/app.js')
-rw-r--r-- | ui/app/reducers/app.js | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index f76b73132..7be9b8d40 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -51,6 +51,7 @@ function reduceApp (state, action) { sidebarOpen: false, alertOpen: false, alertMessage: null, + qrCodeData: null, networkDropdownOpen: false, currentView: seedWords ? seedConfView : defaultView, accountDetail: { @@ -65,6 +66,11 @@ function reduceApp (state, action) { buyView: {}, isMouseUser: false, gasIsLoading: false, + networkNonce: null, + defaultHdPaths: { + trezor: `m/44'/60'/0'/0`, + ledger: `m/44'/60'/0'/0/0`, + }, }, state.appState) switch (action.type) { @@ -90,7 +96,7 @@ function reduceApp (state, action) { sidebarOpen: false, }) - // sidebar methods + // alert methods case actions.ALERT_OPEN: return extend(appState, { alertOpen: true, @@ -103,6 +109,13 @@ function reduceApp (state, action) { alertMessage: null, }) + // qr scanner methods + case actions.QR_CODE_DETECTED: + return extend(appState, { + qrCodeData: action.value, + }) + + // modal methods: case actions.MODAL_OPEN: const { name, ...modalProps } = action.payload @@ -525,6 +538,15 @@ function reduceApp (state, action) { warning: '', }) + case actions.SET_HARDWARE_WALLET_DEFAULT_HD_PATH: + const { device, path } = action.value + const newDefaults = {...appState.defaultHdPaths} + newDefaults[device] = path + + return extend(appState, { + defaultHdPaths: newDefaults, + }) + case actions.SHOW_LOADING: return extend(appState, { isLoading: true, @@ -710,6 +732,11 @@ function reduceApp (state, action) { gasIsLoading: false, }) + case actions.SET_NETWORK_NONCE: + return extend(appState, { + networkNonce: action.value, + }) + default: return appState } |