aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-08-14 07:29:43 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-08-14 07:29:43 +0800
commit4e1d8ba19db729f5c282c4e3c6b43433b562a45e (patch)
tree6d8470f9289247a9f4998e44de075674486c6125 /ui/app/actions.js
parent77ad856730d5b54974b86e9bed7952ff1dc10fe0 (diff)
downloadtangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.tar
tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.tar.gz
tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.tar.bz2
tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.tar.lz
tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.tar.xz
tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.tar.zst
tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.zip
good progress adding paths
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js27
1 files changed, 18 insertions, 9 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 04af9d7c8..6bcc64e17 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -235,6 +235,8 @@ var actions = {
UPDATE_TOKENS: 'UPDATE_TOKENS',
setRpcTarget: setRpcTarget,
setProviderType: setProviderType,
+ SET_HARDWARE_WALLET_DEFAULT_HD_PATH: 'SET_HARDWARE_WALLET_DEFAULT_HD_PATH',
+ setHardwareWalletDefaultHdPath,
updateProviderType,
// loading overlay
SHOW_LOADING: 'SHOW_LOADING_INDICATION',
@@ -639,12 +641,12 @@ function addNewAccount () {
}
}
-function checkHardwareStatus (deviceName) {
- log.debug(`background.checkHardwareStatus`, deviceName)
+function checkHardwareStatus (deviceName, hdPath) {
+ log.debug(`background.checkHardwareStatus`, deviceName, hdPath)
return (dispatch, getState) => {
dispatch(actions.showLoadingIndication())
return new Promise((resolve, reject) => {
- background.checkHardwareStatus(deviceName, (err, unlocked) => {
+ background.checkHardwareStatus(deviceName, hdPath, (err, unlocked) => {
if (err) {
log.error(err)
dispatch(actions.displayWarning(err.message))
@@ -681,12 +683,12 @@ function forgetDevice (deviceName) {
}
}
-function connectHardware (deviceName, page) {
- log.debug(`background.connectHardware`, deviceName, page)
+function connectHardware (deviceName, page, hdPath) {
+ log.debug(`background.connectHardware`, deviceName, page, hdPath)
return (dispatch, getState) => {
dispatch(actions.showLoadingIndication())
return new Promise((resolve, reject) => {
- background.connectHardware(deviceName, page, (err, accounts) => {
+ background.connectHardware(deviceName, page, hdPath, (err, accounts) => {
if (err) {
log.error(err)
dispatch(actions.displayWarning(err.message))
@@ -702,12 +704,12 @@ function connectHardware (deviceName, page) {
}
}
-function unlockHardwareWalletAccount (index, deviceName) {
- log.debug(`background.unlockHardwareWalletAccount`, index, deviceName)
+function unlockHardwareWalletAccount (index, deviceName, hdPath) {
+ log.debug(`background.unlockHardwareWalletAccount`, index, deviceName, hdPath)
return (dispatch, getState) => {
dispatch(actions.showLoadingIndication())
return new Promise((resolve, reject) => {
- background.unlockHardwareWalletAccount(index, deviceName, (err, accounts) => {
+ background.unlockHardwareWalletAccount(index, deviceName, hdPath, (err, accounts) => {
if (err) {
log.error(err)
dispatch(actions.displayWarning(err.message))
@@ -1854,6 +1856,13 @@ function showLoadingIndication (message) {
}
}
+function setHardwareWalletDefaultHdPath ({ device, path }) {
+ return {
+ type: actions.SET_HARDWARE_WALLET_DEFAULT_HD_PATH,
+ value: {device, path},
+ }
+}
+
function hideLoadingIndication () {
return {
type: actions.HIDE_LOADING,