add redirs to internal pages

This commit is contained in:
Matias Alejo Garcia 2014-10-10 17:58:19 -03:00
commit bdaf40de48
11 changed files with 88 additions and 65 deletions

View file

@ -2,6 +2,9 @@
angular.module('copayApp.controllers').controller('AddressesController',
function($scope, $rootScope, $timeout, $modal, controllerUtils) {
controllerUtils.redirIfNotComplete();
$scope.loading = false;
$scope.showAll = false;
var w = $rootScope.wallet;

View file

@ -139,9 +139,8 @@ angular.module('copayApp.controllers').controller('JoinController',
notification.error('Unknown error');
controllerUtils.onErrorDigest();
} else {
$scope.loading = false;
$rootScope.wallet = w;
controllerUtils.bindWallet(w, $scope);
controllerUtils.installWalletHandlers($scope, w);
controllerUtils.setFocusedWallet(w);
}
});
}

View file

@ -2,9 +2,11 @@
angular.module('copayApp.controllers').controller('MoreController',
function($scope, $rootScope, $location, $filter, backupService, controllerUtils, notification, rateService) {
controllerUtils.redirIfNotComplete();
var w = $rootScope.wallet;
$scope.isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
$scope.unitOpts = [{
name: 'Satoshis (100,000,000 satoshis = 1BTC)',
shortName: 'SAT',

View file

@ -4,6 +4,8 @@ var preconditions = require('preconditions').singleton();
angular.module('copayApp.controllers').controller('SendController',
function($scope, $rootScope, $window, $timeout, $anchorScroll, $modal, isMobile, notification, controllerUtils, rateService) {
controllerUtils.redirIfNotComplete();
var w = $rootScope.wallet;
preconditions.checkState(w);
preconditions.checkState(w.settings.unitToSatoshi);

View file

@ -36,11 +36,13 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
$scope.refresh = function() {
var w = $rootScope.wallet;
w.sendWalletReady();
if ($rootScope.addrInfos.length > 0) {
controllerUtils.updateBalance(function() {
$rootScope.$digest();
});
if (w.isReady()) {
w.sendWalletReady();
if ($rootScope.addrInfos.length > 0) {
controllerUtils.updateBalance(function() {
$rootScope.$digest();
});
}
}
};

View file

@ -3,6 +3,8 @@ var bitcore = require('bitcore');
angular.module('copayApp.controllers').controller('TransactionsController',
function($scope, $rootScope, $timeout, controllerUtils, notification, rateService) {
controllerUtils.redirIfNotComplete();
var w = $rootScope.wallet;