From 1a0992e2ce374e8f39dbf74a1be4361705755d2b Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 4 Feb 2020 16:22:41 +0100 Subject: [PATCH] bind all getCallBacksWithContext functions --- src/app/ui/sendTxCallbacks.js | 4 ++-- src/app/ui/universal-dapp-ui.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/ui/sendTxCallbacks.js b/src/app/ui/sendTxCallbacks.js index a300d6ab11..7c9d72cdac 100644 --- a/src/app/ui/sendTxCallbacks.js +++ b/src/app/ui/sendTxCallbacks.js @@ -18,7 +18,7 @@ module.exports = { } } -const continueCb = (error, continueTxExecution, cancelCb) => { +const continueCb = function (error, continueTxExecution, cancelCb) { if (error) { const msg = typeof error !== 'string' ? error.message : error modalDialog( @@ -41,7 +41,7 @@ const continueCb = (error, continueTxExecution, cancelCb) => { } } -const promptCb = (okCb, cancelCb) => { +const promptCb = function (okCb, cancelCb) { modalCustom.promptPassphrase('Passphrase requested', 'Personal mode is enabled. Please provide passphrase of account', '', okCb, cancelCb) } diff --git a/src/app/ui/universal-dapp-ui.js b/src/app/ui/universal-dapp-ui.js index 113dc8cac0..0818b6006e 100644 --- a/src/app/ui/universal-dapp-ui.js +++ b/src/app/ui/universal-dapp-ui.js @@ -253,7 +253,7 @@ UniversalDAppUI.prototype.runTransaction = function (lookupOnly, args, valArr, i self.logCallback(`${logMsg}`) } if (args.funABI.type === 'fallback') data.dataHex = value - self.udapp.callFunction(args.address, data, args.funABI, callbacksInContext.confirmationCb.bind(callbacksInContext), callbacksInContext.continueCb, callbacksInContext.promptCb, (error, txResult) => { + self.udapp.callFunction(args.address, data, args.funABI, callbacksInContext.confirmationCb.bind(callbacksInContext), callbacksInContext.continueCb.bind(callbacksInContext), callbacksInContext.promptCb.bind(callbacksInContext), (error, txResult) => { if (!error) { var isVM = self.executionContext.isVM() if (isVM) { @@ -278,7 +278,7 @@ UniversalDAppUI.prototype.runTransaction = function (lookupOnly, args, valArr, i self.logCallback(msg) }, (data, runTxCallback) => { // called for libraries deployment - self.udapp.runTx(data, callbacksInContext.confirmationCb, runTxCallback) + self.udapp.runTx(data, callbacksInContext.confirmationCb.bind(callbacksInContext), runTxCallback) }) }