fix txStatus modal

This commit is contained in:
Matias Alejo Garcia 2016-09-02 10:30:26 -03:00
commit a95f37ce54
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
7 changed files with 50 additions and 77 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, txStatus, gettext, txFormatService, ongoingProcess, $ionicModal, popupService) {
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, $ionicPopup, gettext, txFormatService, ongoingProcess, $ionicModal, popupService) {
$ionicNavBarDelegate.title(gettextCatalog.getString('Confirm'));
var cachedTxp = {};
var isChromeApp = platformInfo.isChromeApp;

View file

@ -7,5 +7,4 @@ angular.module('copayApp.controllers').controller('txStatusController', function
$scope.cancel = function() {
$scope.txStatusModal.hide();
};
});

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('txpDetailsController', function($scope, $rootScope, $timeout, $interval, $ionicModal, ongoingProcess, platformInfo, txStatus, $ionicScrollDelegate, txFormatService, fingerprintService, bwcError, gettextCatalog, lodash, walletService, popupService) {
angular.module('copayApp.controllers').controller('txpDetailsController', function($scope, $rootScope, $timeout, $interval, $ionicModal, ongoingProcess, platformInfo, $ionicScrollDelegate, txFormatService, fingerprintService, bwcError, gettextCatalog, lodash, walletService, popupService) {
var self = $scope.self;
var tx = $scope.tx;
var copayers = $scope.copayers;
@ -32,6 +32,9 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.sign = function() {
$scope.loading = true;
walletService.publishAndSign($scope.wallet, $scope.tx, function(err, txp) {
console.log('[txpDetails.js.35] AFTER publush'); //TODO
$scope.$emit('UpdateTx');
if (err) return setSendError(err);
$scope.close(txp);
@ -174,28 +177,6 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.close = function(txp) {
$scope.loading = null;
if (txp) {
var type = txStatus.notify(txp);
$scope.openStatusModal(type, txp, function() {});
}
$scope.cancel();
};
$scope.openStatusModal = function(type, txp, cb) {
$scope.type = type;
$scope.tx = txFormatService.processTx(txp);
$scope.cb = cb;
$ionicModal.fromTemplateUrl('views/modals/tx-status.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.txStatusModal = modal;
$scope.txStatusModal.show();
});
};
$scope.cancel = function() {
$scope.txpDetailsModal.hide();
};
});

View file

@ -1,5 +1,5 @@
angular.module('copayApp.controllers').controller('paperWalletController',
function($scope, $timeout, $log, $ionicModal, configService, profileService, $state, addressService, txStatus, bitcore, ongoingProcess, txFormatService, $stateParams) {
function($scope, $timeout, $log, $ionicModal, configService, profileService, $state, addressService, bitcore, ongoingProcess, txFormatService, $stateParams, walletService) {
var wallet = profileService.getWallet($stateParams.walletId);
var rawTx;
@ -100,7 +100,7 @@ angular.module('copayApp.controllers').controller('paperWalletController',
$scope.error = err.message || err.toString();
$log.error(err);
} else {
var type = txStatus.notify(txp);
var type = walletService.getViewStatus(wallet, txp);
$scope.openStatusModal(type, txp, function() {
$state.go('tabs.home');
});