fix timming in modal
This commit is contained in:
parent
5bf0b93089
commit
7028f6f1c5
4 changed files with 22 additions and 23 deletions
|
|
@ -649,7 +649,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.updateAll();
|
self.updateAll();
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
self.updateTxHistory();
|
self.updateTxHistory();
|
||||||
}, 5000);
|
}, 3000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -486,10 +486,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
}
|
}
|
||||||
|
|
||||||
self.signAndBroadcast(txp, function(err) {
|
self.signAndBroadcast(txp, function(err) {
|
||||||
profileService.lockFC();
|
if (err)
|
||||||
if (err) {
|
|
||||||
return self.setError(err);
|
return self.setError(err);
|
||||||
}
|
|
||||||
self.resetForm();
|
self.resetForm();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -504,9 +503,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
profileService.lockFC();
|
profileService.lockFC();
|
||||||
self.setOngoingProcess();
|
self.setOngoingProcess();
|
||||||
|
|
||||||
if (err) {
|
if (err)
|
||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
|
||||||
|
|
||||||
if (signedTx.status == 'accepted') {
|
if (signedTx.status == 'accepted') {
|
||||||
self.setOngoingProcess('Broadcasting transaction');
|
self.setOngoingProcess('Broadcasting transaction');
|
||||||
|
|
@ -515,16 +513,14 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
if (err) {
|
if (err) {
|
||||||
$scope.error = 'Transaction not broadcasted. Please try again.';
|
$scope.error = 'Transaction not broadcasted. Please try again.';
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
} else {
|
return;
|
||||||
txStatus.notify(btx);
|
}
|
||||||
$scope.$emit('Local/TxProposalAction');
|
$scope.$emit('Local/TxProposalAction');
|
||||||
}
|
txStatus.notify(btx, cb);
|
||||||
return cb();
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
txStatus.notify(signedTx);
|
|
||||||
$scope.$emit('Local/TxProposalAction');
|
$scope.$emit('Local/TxProposalAction');
|
||||||
return cb();
|
txStatus.notify(signedTx, cb);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,15 @@ angular
|
||||||
var orig = $delegate[level];
|
var orig = $delegate[level];
|
||||||
$delegate[level] = function() {
|
$delegate[level] = function() {
|
||||||
var args = [].slice.call(arguments);
|
var args = [].slice.call(arguments);
|
||||||
|
if (!Array.isArray(args)) args = [args];
|
||||||
args = args.map(function(v) {
|
args = args.map(function(v) {
|
||||||
try {
|
try {
|
||||||
if (typeof v == 'undefined') v = 'undefined';
|
if (typeof v == 'undefined') v = 'undefined';
|
||||||
if (typeof v == 'object') {
|
if (typeof v == 'object') {
|
||||||
v = JSON.stringify(v);
|
if (v.message)
|
||||||
|
v = v.message;
|
||||||
|
else
|
||||||
|
v = JSON.stringify(v);
|
||||||
}
|
}
|
||||||
v = v.toString();
|
v = v.toString();
|
||||||
if (v.length > 200)
|
if (v.length > 200)
|
||||||
|
|
@ -46,7 +50,7 @@ angular
|
||||||
try {
|
try {
|
||||||
if (window.cordova)
|
if (window.cordova)
|
||||||
console.log(args.join(' '));
|
console.log(args.join(' '));
|
||||||
orig.apply(null, args)
|
orig.apply(null, args);
|
||||||
historicLog.add(level, args.join(' '));
|
historicLog.add(level, args.join(' '));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('Error at log decorator:', e);
|
console.log('Error at log decorator:', e);
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,17 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.services').factory('txStatus', function($modal, lodash, profileService) {
|
angular.module('copayApp.services').factory('txStatus', function($modal, lodash, profileService, $timeout) {
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
root.notify = function(txp) {
|
root.notify = function(txp, cb) {
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
var msg;
|
var msg;
|
||||||
|
|
||||||
var status = txp.status;
|
var status = txp.status;
|
||||||
|
|
||||||
if (status == 'broadcasted') {
|
if (status == 'broadcasted') {
|
||||||
msg = 'Transaction broadcasted';
|
msg = 'Transaction broadcasted';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var action = lodash.find(txp.actions, {
|
var action = lodash.find(txp.actions, {
|
||||||
copayerId: fc.credentials.copayerId
|
copayerId: fc.credentials.copayerId
|
||||||
});
|
});
|
||||||
|
|
@ -25,16 +24,16 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg)
|
root.openModal(msg, cb);
|
||||||
root.openModal(msg);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
root.openModal = function(statusStr) {
|
root.openModal = function(statusStr, cb) {
|
||||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||||
$scope.statusStr = statusStr;
|
$scope.statusStr = statusStr;
|
||||||
$scope.cancel = function() {
|
$scope.cancel = function() {
|
||||||
$modalInstance.dismiss('cancel');
|
$modalInstance.dismiss('cancel');
|
||||||
};
|
};
|
||||||
|
if (cb) $timeout(cb, 100);
|
||||||
};
|
};
|
||||||
$modal.open({
|
$modal.open({
|
||||||
templateUrl: 'views/modals/tx-status.html',
|
templateUrl: 'views/modals/tx-status.html',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue