fix timming in modal

This commit is contained in:
Matias Alejo Garcia 2015-04-27 02:07:26 -03:00
commit 7028f6f1c5
4 changed files with 22 additions and 23 deletions

View file

@ -649,7 +649,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.updateAll();
$timeout(function() {
self.updateTxHistory();
}, 5000);
}, 3000);
});
});

View file

@ -486,10 +486,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
}
self.signAndBroadcast(txp, function(err) {
profileService.lockFC();
if (err) {
if (err)
return self.setError(err);
}
self.resetForm();
});
});
@ -504,9 +503,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
profileService.lockFC();
self.setOngoingProcess();
if (err) {
if (err)
return cb(err);
}
if (signedTx.status == 'accepted') {
self.setOngoingProcess('Broadcasting transaction');
@ -515,16 +513,14 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
if (err) {
$scope.error = 'Transaction not broadcasted. Please try again.';
$scope.$digest();
} else {
txStatus.notify(btx);
$scope.$emit('Local/TxProposalAction');
}
return cb();
return;
}
$scope.$emit('Local/TxProposalAction');
txStatus.notify(btx, cb);
});
} else {
txStatus.notify(signedTx);
$scope.$emit('Local/TxProposalAction');
return cb();
txStatus.notify(signedTx, cb);
}
});
};

View file

@ -28,11 +28,15 @@ angular
var orig = $delegate[level];
$delegate[level] = function() {
var args = [].slice.call(arguments);
if (!Array.isArray(args)) args = [args];
args = args.map(function(v) {
try {
if (typeof v == 'undefined') v = 'undefined';
if (typeof v == 'object') {
v = JSON.stringify(v);
if (v.message)
v = v.message;
else
v = JSON.stringify(v);
}
v = v.toString();
if (v.length > 200)
@ -46,7 +50,7 @@ angular
try {
if (window.cordova)
console.log(args.join(' '));
orig.apply(null, args)
orig.apply(null, args);
historicLog.add(level, args.join(' '));
} catch (e) {
console.log('Error at log decorator:', e);

View file

@ -1,18 +1,17 @@
'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 = {};
root.notify = function(txp) {
root.notify = function(txp, cb) {
var fc = profileService.focusedClient;
var msg;
var status = txp.status;
if (status == 'broadcasted') {
msg = 'Transaction broadcasted';
}
else {
} else {
var action = lodash.find(txp.actions, {
copayerId: fc.credentials.copayerId
});
@ -25,16 +24,16 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash,
}
}
if (msg)
root.openModal(msg);
root.openModal(msg, cb);
};
root.openModal = function(statusStr) {
root.openModal = function(statusStr, cb) {
var ModalInstanceCtrl = function($scope, $modalInstance) {
$scope.statusStr = statusStr;
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
if (cb) $timeout(cb, 100);
};
$modal.open({
templateUrl: 'views/modals/tx-status.html',