Fix receive and copayers views

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-29 19:52:26 -03:00
parent 88b25257ae
commit f57383e2cf
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
3 changed files with 31 additions and 31 deletions

View File

@ -20,7 +20,7 @@
<ion-spinner class="spinner-dark" icon="lines"></ion-spinner> <ion-spinner class="spinner-dark" icon="lines"></ion-spinner>
</div> </div>
</div> </div>
<div class="secret" ng-show="!isCordova"> <div class="secret">
{{secret || ('Loading...'|translate)}} {{secret || ('Loading...'|translate)}}
</div> </div>
</div> </div>
@ -29,11 +29,11 @@
<div ng-show="secret"> <div ng-show="secret">
<div class="text-center m10t" ng-if="isCordova"> <div class="text-center m10t" ng-if="isCordova">
<span class="button outline round dark-gray tiny m0" <button class="button button-outline button-positive"
ng-click="shareSecret()"> ng-click="shareSecret()">
<i class="fi-share"></i> <i class="icon ion-ios-upload-outline"></i>
<span translate>Share invitation</span> <span translate>Share invitation</span>
</span> </button>
</div> </div>
<div class="m30v line-t"> <div class="m30v line-t">

View File

@ -9,7 +9,7 @@
</ion-nav-bar> </ion-nav-bar>
<ion-content> <ion-content>
<div id="address"> <div id="address">
<article class="text-center" ng-if="!wallet.isComplete()"> <article class="text-center" ng-if="wallet && !wallet.isComplete()">
<div class="incomplete"> <div class="incomplete">
<div class="title"> <div class="title">
<span translate>Incomplete wallet</span> <span translate>Incomplete wallet</span>
@ -30,7 +30,7 @@
</div> </div>
</div> </div>
</article> </article>
<article ng-if="wallet.isComplete()"> <article ng-if="wallet && wallet.isComplete()">
<div class="row backup" ng-show="!wallet.showBackupNeededModal && wallet.needsBackup" ng-click="goToBackupFlow()"> <div class="row backup" ng-show="!wallet.showBackupNeededModal && wallet.needsBackup" ng-click="goToBackupFlow()">
<div class="m15t text-center col center-block"> <div class="m15t text-center col center-block">
<i class="icon ion-alert"></i><span translate>Wallet not backed up</span><i class="icon ion-ios-arrow-thin-right"></i> <i class="icon ion-alert"></i><span translate>Wallet not backed up</span><i class="icon ion-ios-arrow-thin-right"></i>

View File

@ -33,31 +33,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.addr = null; $scope.addr = null;
$scope.generatingAddress = true; $scope.generatingAddress = true;
$timeout(function() { walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
walletService.getAddress($scope.wallet, forceNew, function(err, addr) { $scope.generatingAddress = false;
$scope.generatingAddress = false; if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err); $scope.addr = addr;
$scope.addr = addr; if ($scope.wallet.showBackupNeededModal) $scope.openBackupNeededModal();
if ($scope.wallet.showBackupNeededModal) $scope.openBackupNeededModal();
$scope.$apply();
});
}, 100);
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
if (!$scope.isCordova) $scope.checkTips();
$scope.wallets = profileService.getWallets();
$scope.$on('Wallet/Changed', function(event, wallet) {
if (!wallet) {
$log.debug('No wallet provided');
return;
}
$scope.wallet = wallet;
$log.debug('Wallet changed: ' + wallet.name);
$scope.setAddress();
}); });
}); };
$scope.goCopayers = function() { $scope.goCopayers = function() {
$ionicHistory.removeBackView(); $ionicHistory.removeBackView();
@ -99,5 +81,23 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
from: 'tabs.receive', from: 'tabs.receive',
walletId: $scope.wallet.credentials.walletId walletId: $scope.wallet.credentials.walletId
}); });
} };
if (!$scope.isCordova) $scope.checkTips();
$scope.$on('Wallet/Changed', function(event, wallet) {
if (!wallet) {
$log.debug('No wallet provided');
return;
}
$scope.wallet = wallet;
$log.debug('Wallet changed: ' + wallet.name);
$scope.setAddress();
$timeout(function() {
$scope.$apply();
}, 100);
});
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.wallets = profileService.getWallets();
});
}); });