delete unused code and fixes

This commit is contained in:
Gabriel Bazán 2016-10-11 10:19:05 -03:00
commit e2b995102c
5 changed files with 20 additions and 104 deletions

View file

@ -57,7 +57,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
} }
var filteredWallets = []; var filteredWallets = [];
var index = 0, enoughFunds = false; var index = 0;
var enoughFunds = false;
lodash.each(wallets, function(w) { lodash.each(wallets, function(w) {
walletService.getStatus(w, {}, function(err, status) { walletService.getStatus(w, {}, function(err, status) {
@ -311,6 +312,9 @@ angular.module('copayApp.controllers').controller('confirmController', function(
popupService.showConfirm(null, message, okText, cancelText, function(ok) { popupService.showConfirm(null, message, okText, cancelText, function(ok) {
if (!ok) { if (!ok) {
$scope.sendStatus = ''; $scope.sendStatus = '';
$timeout(function() {
$scope.$apply();
});
return; return;
} }
publishAndSign(wallet, txp, onSendStatusChange); publishAndSign(wallet, txp, onSendStatusChange);
@ -331,14 +335,11 @@ angular.module('copayApp.controllers').controller('confirmController', function(
}; };
function statusChangeHandler(processName, showName, isOn) { function statusChangeHandler(processName, showName, isOn) {
console.log('in statusChangeHandler', processName, showName, isOn); $log.debug('statusChangeHandler: ', processName, showName, isOn);
console.log('$scope.wallet', $scope.wallet); if ((processName === 'broadcastingTx' || ((processName === 'signingTx') && $scope.wallet.m > 1)) && !isOn) {
if(
(processName === 'broadcastingTx' ||
((processName === 'signingTx') && $scope.wallet.m > 1)) && !isOn) {
$scope.sendStatus = 'success'; $scope.sendStatus = 'success';
$scope.$digest(); $scope.$digest();
} else if(showName) { } else if (showName) {
$scope.sendStatus = showName; $scope.sendStatus = showName;
} }
} }

View file

@ -1,49 +1,11 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout, $state, $stateParams, $ionicHistory, $log, addressbookService) { angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout) {
if ($scope.cb) $timeout($scope.cb, 100); if ($scope.cb) $timeout($scope.cb, 100);
var previousView = $ionicHistory.viewHistory().backView && $ionicHistory.viewHistory().backView.stateName;
$scope.fromSendTab = previousView.match(/tabs.send/) ? true : false;
$scope.fromBitPayCard = previousView.match(/tabs.bitpayCard/) ? true : false;
$scope.fromPayPro = $stateParams.paypro ? true : false;
$scope.cancel = function() { $scope.cancel = function() {
$scope.txStatusModal.hide(); $scope.txStatusModal.hide();
if ($scope.fromSendTab) {
$ionicHistory.removeBackView();
$state.go('tabs.send');
$timeout(function() {
$state.transitionTo('tabs.home');
}, 100);
} else if ($scope.fromBitPayCard) {
$ionicHistory.removeBackView();
$timeout(function() {
$state.transitionTo('tabs.bitpayCard');
}, 100);
}
}; };
$scope.save = function(addressbookEntry) {
$scope.txStatusModal.hide();
$ionicHistory.nextViewOptions({
disableAnimate: true,
disableBack: true
});
$ionicHistory.removeBackView();
$state.go('tabs.send.addressbook', {
fromSendTab: $scope.fromSendTab,
addressbookEntry: addressbookEntry
});
}
addressbookService.list(function(err, ab) {
if (err) $log.error(err);
if (ab[$scope.tx.toAddress]) {
$scope.entryExist = true;
$log.debug('Entry already exist');
}
})
}); });

View file

@ -385,6 +385,10 @@ input[type=number] {
text-transform: lowercase; text-transform: lowercase;
} }
.text-center {
text-align: center;
}
.text-light { .text-light {
font-weight: 200; font-weight: 200;
} }

View file

@ -1,29 +1,4 @@
#tx-status { #tx-status {
.address {
display: flex;
padding: 5px 15px;
background-color: #f5f5f5;
margin-top: 10px;
i {
color: grey;
padding-right: 10px;
border-right: 1px solid;
border-color: grey;
font-size: 20px;
}
contact {
margin-left: 15px;
margin-bottom: 3px;
margin-top: 5px;
}
}
.collect-address {
bottom: 0;
background: #fff;
color: #6c6c6c;
position: absolute;
width: 100%;
}
.popup-txsent { .popup-txsent {
font-size: 5rem; font-size: 5rem;
color: #4A90E2; color: #4A90E2;

View file

@ -1,41 +1,15 @@
<ion-modal-view id="tx-status" ng-controller="txStatusController"> <ion-modal-view id="tx-status" ng-controller="txStatusController">
<div ng-if="type == 'broadcasted'"> <div ng-if="type == 'broadcasted'">
<div class="popup-txsent text-center m30tp"> <div class="popup-txsent text-center m30tp">
<i class="icon ion-checkmark-round"></i> <i class="icon ion-checkmark-round"></i>
<div ng-show="tx.amountStr" class="m20t size-36"> <div ng-show="tx.amountStr" class="m20t size-36">
{{tx.amountStr}} {{tx.amountStr}}
</div>
<div class="size-24 text-gray m20v">
<span ng-if="!fromBitPayCard" translate>Sent</span>
<span ng-if="fromBitPayCard" translate>Funds sent</span>
</div>
<div class="text-center m20t" ng-if="entryExist || !fromSendTab || fromPayPro">
<a class="button button-positive" ng-click="cancel()" translate>OKAY</a>
</div>
</div>
<div class="collect-address" ng-if="!entryExist && fromSendTab && !fromPayPro">
<div class="row">
<p translate class="col">Would you like to add this address to your address book?</p>
</div> </div>
<div class="row"> <div class="size-24 text-gray m20v">
<div class="col"> <span translate>Sent</span>
<span class="address">
<i class="icon ion-social-bitcoin"></i>
<contact class="enable_text_select ellipsis" address="{{tx.toAddress}}"></contact>
</span>
</div>
</div> </div>
<div class="row"> <div class="text-center m20t">
<div class="col col-50"> <a class="button button-positive" ng-click="cancel()" translate>OKAY</a>
<button class="button button-block button-stable" ng-click="cancel()">
{{'Skip' | translate}}
</button>
</div>
<div class="col col-50">
<button class="button button-block button-stable" ng-click="save(tx.toAddress)">
{{'Add Address' | translate}}
</button>
</div>
</div> </div>
</div> </div>
</div> </div>