Skip to content

Commit

Permalink
Did some fixup to transaction signing flow:
Browse files Browse the repository at this point in the history
 - 'ButtonRequest' panel now goes back to previous send panel with
active 'Preparing Transaction' overlay after confirming button press on
KeepKey. This is to ensure the current 'Processed' status is visible
afterwards.
 - The send panel no longer does unnecessary `$watch` when preparing a
transaction.
 - The 'Processed' status now updates more frequently.
  • Loading branch information
greatwolf committed Nov 8, 2022
1 parent 6a1e390 commit 1e70739
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1476,10 +1476,10 @@ var _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
current: e,
total: t
})
}, 1e3,
}, 1e2,
{
leading: !1,
trailing: !0
leading: !0,
trailing: !1
})
}
return e.prototype.action = function(e)
Expand Down Expand Up @@ -3257,10 +3257,10 @@ var _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
current: e,
total: t
})
}, 1e3,
}, 1e2,
{
leading: !1,
trailing: !0
leading: !0,
trailing: !1
})
}
return e.prototype.action = function(e)
Expand Down
25 changes: 19 additions & 6 deletions chrome-wallet/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,19 @@ angular.module('kkWallet', ['ngRoute', 'ngAnimate', 'ui.bootstrap', 'monospaced.
}]),
angular.module('kkWallet').controller('SignTxController', ['$scope', '$routeParams', 'TransactionService', 'NavigationService', function(e, t, n, a)
{
'/buttonRequest/button_request_sign_tx' === a.getCurrentRoute() ? a.setNextTransition('slideRight') : a.setNextTransition('slideLeft'),
e.buttonRequestType = t.code,
e.amount = n.transactionInProgress.amount,
e.destination = n.transactionInProgress.address,
e.fee = 'TBD'
let req_signtx = '/buttonRequest/button_request_sign_tx' === a.getCurrentRoute()
if (req_signtx)
{
e.$on('Processed', function()
{
a.goToPrevious()
})
}
a.setNextTransition(req_signtx ? 'slideRight' : 'slideLeft')
e.buttonRequestType = t.code,
e.amount = n.transactionInProgress.amount,
e.destination = n.transactionInProgress.address,
e.fee = 'TBD'
}]),
angular.module('kkWallet').controller('CharacterRequestController', ['$scope', '$routeParams', '$timeout', 'RecoveryCipherModel', function(e, t, n, a)
{
Expand Down Expand Up @@ -1864,7 +1872,10 @@ angular.module('kkWallet', ['ngRoute', 'ngAnimate', 'ui.bootstrap', 'monospaced.
feeLevel: e.config.regularFeeLevel
},
e.destinationCurrency = '',
e.accountCurrencyUrl = 'assets/currency-logos/' + e.currency.toLowerCase() + '.png',
e.accountCurrencyUrl = 'assets/currency-logos/' + e.currency.toLowerCase() + '.png';

if (e.preparingTransaction) return

e.buildTransaction = function()
{
if (e.form.$submitted = !0,
Expand Down Expand Up @@ -2063,6 +2074,8 @@ angular.module('kkWallet', ['ngRoute', 'ngAnimate', 'ui.bootstrap', 'monospaced.
var n, a = _.get(this, 'request.message.data');
if ('ButtonRequest_ConfirmOutput' === this.request.message.code)
pinLock.reset();
if ('ButtonRequest_SignTx' === this.request.message.code)
pinLock.state = pinLock.verifying; // So 'Preparing Transaction' overlay is shown
a ? (n = a.split(':'),
this.request.message.policy = n[0],
this.request.message.state = n[1],
Expand Down

0 comments on commit 1e70739

Please sign in to comment.