aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-02-23 08:23:13 +0800
committerDan Finlay <dan@danfinlay.com>2017-02-23 08:30:09 +0800
commit564f920ae0a1be1aa08905f1b4cf6d081e9a5a0b (patch)
tree990ef92dfffa47160100553857c1d4da95e33162 /ui/app/actions.js
parent8684fc40c78cb5293d85f751cf3927c14067d343 (diff)
downloadtangerine-wallet-browser-564f920ae0a1be1aa08905f1b4cf6d081e9a5a0b.tar
tangerine-wallet-browser-564f920ae0a1be1aa08905f1b4cf6d081e9a5a0b.tar.gz
tangerine-wallet-browser-564f920ae0a1be1aa08905f1b4cf6d081e9a5a0b.tar.bz2
tangerine-wallet-browser-564f920ae0a1be1aa08905f1b4cf6d081e9a5a0b.tar.lz
tangerine-wallet-browser-564f920ae0a1be1aa08905f1b4cf6d081e9a5a0b.tar.xz
tangerine-wallet-browser-564f920ae0a1be1aa08905f1b4cf6d081e9a5a0b.tar.zst
tangerine-wallet-browser-564f920ae0a1be1aa08905f1b4cf6d081e9a5a0b.zip
Add personal sign actions and template
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 6552e7f5c..6060d4299 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -90,6 +90,8 @@ var actions = {
PREVIOUS_TX: 'PREV_TX',
signMsg: signMsg,
cancelMsg: cancelMsg,
+ signPersonalMsg,
+ cancelPersonalMsg,
sendTx: sendTx,
signTx: signTx,
cancelTx: cancelTx,
@@ -359,6 +361,20 @@ function signMsg (msgData) {
}
}
+function signPersonalMsg (msgData) {
+ return (dispatch) => {
+ dispatch(actions.showLoadingIndication())
+
+ if (global.METAMASK_DEBUG) console.log(`background.signMessage`)
+ background.signPersonalMessage(msgData, (err) => {
+ dispatch(actions.hideLoadingIndication())
+
+ if (err) return dispatch(actions.displayWarning(err.message))
+ dispatch(actions.completedTx(msgData.metamaskId))
+ })
+ }
+}
+
function signTx (txData) {
return (dispatch) => {
if (global.METAMASK_DEBUG) console.log(`background.setGasMultiplier`)
@@ -408,6 +424,12 @@ function cancelMsg (msgData) {
return actions.completedTx(msgData.id)
}
+function cancelPersonalMsg (msgData) {
+ if (global.METAMASK_DEBUG) console.log(`background.cancelMessage`)
+ background.cancelPersonalMessage(msgData.id)
+ return actions.completedTx(msgData.id)
+}
+
function cancelTx (txData) {
if (global.METAMASK_DEBUG) console.log(`background.cancelTransaction`)
background.cancelTransaction(txData.id)