Fix spinner when sign/reject/remove/broadcast a transaction
This commit is contained in:
parent
32c4d1e472
commit
68cc09f4ab
11 changed files with 52 additions and 51 deletions
|
|
@ -12,7 +12,7 @@
|
||||||
<section class="right-small" ng-show="!goBackToState">
|
<section class="right-small" ng-show="!goBackToState">
|
||||||
<a ng-show="!closeToHome && index.isComplete" class="p10"
|
<a ng-show="!closeToHome && index.isComplete" class="p10"
|
||||||
ng-click="topbar.openScanner()"><i class="fi-camera size-24"></i></a>
|
ng-click="topbar.openScanner()"><i class="fi-camera size-24"></i></a>
|
||||||
<a ng-show="closeToHome"
|
<a ng-show="closeToHome" class="p10"
|
||||||
ng-click="topbar.goHome(); closeToHome = null">
|
ng-click="topbar.goHome(); closeToHome = null">
|
||||||
<span class="text-close">{{'Close'|translate}}</span>
|
<span class="text-close">{{'Close'|translate}}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<nav class="tab-bar">
|
<nav class="tab-bar">
|
||||||
<section class="right-small">
|
<section class="right-small">
|
||||||
<a ng-click="cancel()">
|
<a ng-click="cancel()" class="p10">
|
||||||
<span class="text-close" translate>Close</span>
|
<span class="text-close" translate>Close</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<nav class="tab-bar">
|
<nav class="tab-bar">
|
||||||
<section class="right-small">
|
<section class="right-small">
|
||||||
<a ng-click="cancel()">
|
<a ng-click="cancel()" class="p10">
|
||||||
<span class="text-close" translate>Close</span>
|
<span class="text-close" translate>Close</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<nav class="tab-bar">
|
<nav class="tab-bar">
|
||||||
<section class="right-small">
|
<section class="right-small">
|
||||||
<a ng-click="cancel()">
|
<a ng-click="cancel()" class="p10">
|
||||||
<span class="text-close" translate>Close</span>
|
<span class="text-close" translate>Close</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<nav class="tab-bar">
|
<nav class="tab-bar">
|
||||||
<section class="right-small">
|
<section class="right-small">
|
||||||
<a ng-click="cancel()">
|
<a ng-click="cancel()" class="p10">
|
||||||
<span class="text-close" translate>Close</span>
|
<span class="text-close" translate>Close</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<nav class="tab-bar">
|
<nav class="tab-bar">
|
||||||
<section class="right-small">
|
<section class="right-small">
|
||||||
<a ng-click="cancel()">
|
<a ng-click="cancel()" class="p10">
|
||||||
<span class="text-close" translate>Close</span>
|
<span class="text-close" translate>Close</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@
|
||||||
<button class="button black expand" ng-click="$root.go('add')" translate>Create</button>
|
<button class="button black expand" ng-click="$root.go('add')" translate>Create</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="onGoingProcess" ng-show="index.isOffline" style="background-color:#222">
|
<div class="onGoingProcess" ng-show="index.isOffline">
|
||||||
|
<div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">
|
||||||
<div class="spinner">
|
<div class="spinner">
|
||||||
<div class="rect1"></div>
|
<div class="rect1"></div>
|
||||||
<div class="rect2"></div>
|
<div class="rect2"></div>
|
||||||
|
|
@ -16,9 +17,11 @@
|
||||||
<div class="rect5"></div>
|
<div class="rect5"></div>
|
||||||
</div>
|
</div>
|
||||||
<span translate>Reconnecting to Wallet Service...</span>
|
<span translate>Reconnecting to Wallet Service...</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="onGoingProcess" ng-show="index.anyOnGoingProcess && !index.isOffline" ng-style="{'background-color':index.backgroundColor}">
|
<div class="onGoingProcess" ng-show="index.anyOnGoingProcess && !index.isOffline">
|
||||||
|
<div class="onGoingProcess-content" ng-style="{'background-color':index.backgroundColor}">
|
||||||
<div class="spinner">
|
<div class="spinner">
|
||||||
<div class="rect1"></div>
|
<div class="rect1"></div>
|
||||||
<div class="rect2"></div>
|
<div class="rect2"></div>
|
||||||
|
|
@ -27,15 +30,17 @@
|
||||||
<div class="rect5"></div>
|
<div class="rect5"></div>
|
||||||
</div>
|
</div>
|
||||||
<span translate ng-show="
|
<span translate ng-show="
|
||||||
index.onGoingProcessName == 'openingWallet'
|
index.onGoingProcessName == 'openingWallet'
|
||||||
|| index.onGoingProcessName == 'updatingStatus'
|
|| index.onGoingProcessName == 'updatingStatus'
|
||||||
|| index.onGoingProcessName == 'updatingBalance'
|
|| index.onGoingProcessName == 'updatingBalance'
|
||||||
"> Updating Wallet... </span>
|
"> Updating Wallet... </span>
|
||||||
<span translate ng-show="index.onGoingProcessName == 'scanning'">Scanning Wallet funds...</span>
|
<span translate ng-show="index.onGoingProcessName == 'scanning'">Scanning Wallet funds...</span>
|
||||||
<span translate ng-show="index.onGoingProcessName == 'recreating'">Recreating Wallet...</span>
|
<span translate ng-show="index.onGoingProcessName == 'recreating'">Recreating Wallet...</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="onGoingProcess" ng-show="home.onGoingProcess && !index.anyOnGoingProcess">
|
<div class="onGoingProcess" ng-show="home.onGoingProcess && !index.anyOnGoingProcess">
|
||||||
|
<div class="onGoingProcess-content" ng-style="{'background-color':index.backgroundColor}">
|
||||||
<div class="spinner">
|
<div class="spinner">
|
||||||
<div class="rect1"></div>
|
<div class="rect1"></div>
|
||||||
<div class="rect2"></div>
|
<div class="rect2"></div>
|
||||||
|
|
@ -44,6 +49,7 @@ index.onGoingProcessName == 'openingWallet'
|
||||||
<div class="rect5"></div>
|
<div class="rect5"></div>
|
||||||
</div>
|
</div>
|
||||||
{{home.onGoingProcess|translate}}...
|
{{home.onGoingProcess|translate}}...
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="oh" ng-show="!index.noFocusedWallet">
|
<div class="oh" ng-show="!index.noFocusedWallet">
|
||||||
|
|
|
||||||
|
|
@ -1116,25 +1116,26 @@ input.ng-invalid-match, input.ng-invalid-match:focus {
|
||||||
}
|
}
|
||||||
|
|
||||||
.onGoingProcess {
|
.onGoingProcess {
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 90px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1020;
|
||||||
|
}
|
||||||
|
|
||||||
|
.onGoingProcess-content {
|
||||||
background: #213140;
|
background: #213140;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
max-width: 16.5rem;
|
max-width: 16.5rem;
|
||||||
max-height: 3.5rem;
|
max-height: 3.5rem;
|
||||||
top:auto;
|
|
||||||
left:0;
|
|
||||||
right:0;
|
|
||||||
bottom:170px;
|
|
||||||
margin: auto;
|
margin: auto;
|
||||||
border-radius: 3px;
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
position: absolute;
|
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
z-index: 10;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*/////////////////// SPINNER ////////////////////*/
|
/*/////////////////// SPINNER ////////////////////*/
|
||||||
|
|
||||||
.spinner {
|
.spinner {
|
||||||
|
|
|
||||||
|
|
@ -127,10 +127,10 @@ _:-ms-fullscreen, :root .main {
|
||||||
margin-left: 26px;
|
margin-left: 26px;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-bar .text-close {
|
.tab-bar .text-close {
|
||||||
margin-right: 10px;
|
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
@ -582,6 +582,10 @@ a.pin-button:active {
|
||||||
transform: none !important;
|
transform: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popup-tx-status {
|
||||||
|
z-index: 1030;
|
||||||
|
}
|
||||||
|
|
||||||
.popup-txsent {
|
.popup-txsent {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -155,26 +155,26 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isCordova) {
|
self.setOngoingProcess('Signing transaction');
|
||||||
window.plugins.spinnerDialog.show(null, 'Signing transaction...', true);
|
|
||||||
}
|
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
fc.signTxProposal(txp, function(err, txpsi) {
|
fc.signTxProposal(txp, function(err, txpsi) {
|
||||||
profileService.lockFC();
|
profileService.lockFC();
|
||||||
if (isCordova) {
|
self.setOngoingProcess();
|
||||||
window.plugins.spinnerDialog.hide();
|
|
||||||
}
|
|
||||||
$scope.loading = false;
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
$scope.loading = false;
|
||||||
$scope.error = err.message || 'Transaction not signed. Please try again.';
|
$scope.error = err.message || 'Transaction not signed. Please try again.';
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
} else {
|
} else {
|
||||||
//if txp has required signatures then broadcast it
|
//if txp has required signatures then broadcast it
|
||||||
var txpHasRequiredSignatures = txpsi.status == 'accepted';
|
var txpHasRequiredSignatures = txpsi.status == 'accepted';
|
||||||
if (txpHasRequiredSignatures) {
|
if (txpHasRequiredSignatures) {
|
||||||
|
self.setOngoingProcess('Broadcasting transaction');
|
||||||
|
$scope.loading = true;
|
||||||
fc.broadcastTxProposal(txpsi, function(err, txpsb) {
|
fc.broadcastTxProposal(txpsi, function(err, txpsb) {
|
||||||
|
self.setOngoingProcess();
|
||||||
|
$scope.loading = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
$scope.error = 'Transaction not broadcasted. Please try again.';
|
$scope.error = 'Transaction not broadcasted. Please try again.';
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
|
|
@ -183,6 +183,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
$scope.loading = false;
|
||||||
$modalInstance.close(txpsi);
|
$modalInstance.close(txpsi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -191,16 +192,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.reject = function(txp) {
|
$scope.reject = function(txp) {
|
||||||
if (isCordova) {
|
self.setOngoingProcess('Rejecting transaction');
|
||||||
window.plugins.spinnerDialog.show(null, 'Rejecting transaction...', true);
|
|
||||||
}
|
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
fc.rejectTxProposal(txp, null, function(err, txpr) {
|
fc.rejectTxProposal(txp, null, function(err, txpr) {
|
||||||
if (isCordova) {
|
self.setOngoingProcess();
|
||||||
window.plugins.spinnerDialog.hide();
|
|
||||||
}
|
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
$scope.error = err.message || 'Transaction not rejected. Please try again.';
|
$scope.error = err.message || 'Transaction not rejected. Please try again.';
|
||||||
|
|
@ -214,16 +211,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
|
|
||||||
$scope.remove = function(txp) {
|
$scope.remove = function(txp) {
|
||||||
if (isCordova) {
|
self.setOngoingProcess('Deleting transaction');
|
||||||
window.plugins.spinnerDialog.show(null, 'Deleting transaction...', true);
|
|
||||||
}
|
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
fc.removeTxProposal(txp, function(err, txpb) {
|
fc.removeTxProposal(txp, function(err, txpb) {
|
||||||
if (isCordova) {
|
self.setOngoingProcess();
|
||||||
window.plugins.spinnerDialog.hide();
|
|
||||||
}
|
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
|
|
||||||
// Hacky: request tries to parse an empty response
|
// Hacky: request tries to parse an empty response
|
||||||
|
|
@ -238,16 +231,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.broadcast = function(txp) {
|
$scope.broadcast = function(txp) {
|
||||||
if (isCordova) {
|
self.setOngoingProcess('Broadcasting transaction');
|
||||||
window.plugins.spinnerDialog.show(null, 'Sending transaction...', true);
|
|
||||||
}
|
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
fc.broadcastTxProposal(txp, function(err, txpb) {
|
fc.broadcastTxProposal(txp, function(err, txpb) {
|
||||||
if (isCordova) {
|
self.setOngoingProcess();
|
||||||
window.plugins.spinnerDialog.hide();
|
|
||||||
}
|
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
$scope.error = err.message || 'Transaction not sent. Please try again.';
|
$scope.error = err.message || 'Transaction not sent. Please try again.';
|
||||||
|
|
@ -449,7 +438,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
self.onGoingProcess = name;
|
self.onGoingProcess = name;
|
||||||
$rootScope.$apply();
|
$rootScope.$apply();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -471,7 +460,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.setOngoingProcess('Sending transaction');
|
self.setOngoingProcess('Creating transaction');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
var comment = form.comment.$modelValue;
|
var comment = form.comment.$modelValue;
|
||||||
var paypro = self._paypro;
|
var paypro = self._paypro;
|
||||||
|
|
@ -493,7 +482,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
}
|
}
|
||||||
|
|
||||||
self.signAndBroadcast(txp, function(err) {
|
self.signAndBroadcast(txp, function(err) {
|
||||||
self.setOngoingProcess();
|
|
||||||
profileService.lockFC();
|
profileService.lockFC();
|
||||||
if (err) {
|
if (err) {
|
||||||
return self.setError(err);
|
return self.setError(err);
|
||||||
|
|
@ -512,7 +500,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
profileService.lockFC();
|
profileService.lockFC();
|
||||||
self.setOngoingProcess();
|
self.setOngoingProcess();
|
||||||
|
|
||||||
if (err) return cb(err);
|
if (err) {
|
||||||
|
return cb(err);
|
||||||
|
}
|
||||||
|
|
||||||
if (signedTx.status == 'accepted') {
|
if (signedTx.status == 'accepted') {
|
||||||
self.setOngoingProcess('Broadcasting transaction');
|
self.setOngoingProcess('Broadcasting transaction');
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash,
|
||||||
};
|
};
|
||||||
$modal.open({
|
$modal.open({
|
||||||
templateUrl: 'views/modals/tx-status.html',
|
templateUrl: 'views/modals/tx-status.html',
|
||||||
windowClass: 'full',
|
windowClass: 'full popup-tx-status',
|
||||||
controller: ModalInstanceCtrl,
|
controller: ModalInstanceCtrl,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue