mirror of https://github.com/BTCPrivate/copay.git
improve url checker
This commit is contained in:
parent
ee031849b2
commit
53bc610bbc
|
@ -1,10 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('HomeController',
|
||||
function($scope, $rootScope, $location, walletFactory, notification) {
|
||||
if ($rootScope.wallet) {
|
||||
$location.path('/addresses');
|
||||
}
|
||||
function($scope, $rootScope, $location, walletFactory, notification, controllerUtils) {
|
||||
|
||||
controllerUtils.redirIfLogged();
|
||||
|
||||
$scope.loading = false;
|
||||
if ($rootScope.pendingPayment) {
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('ImportController',
|
||||
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, notification) {
|
||||
if ($rootScope.wallet) {
|
||||
$location.path('/addresses');
|
||||
}
|
||||
|
||||
controllerUtils.redirIfLogged();
|
||||
|
||||
$scope.title = 'Import a backup';
|
||||
$scope.importStatus = 'Importing wallet - Reading backup...';
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('JoinController',
|
||||
function($scope, $rootScope, $timeout, $location, walletFactory, controllerUtils, Passphrase, notification) {
|
||||
if ($rootScope.wallet) {
|
||||
$location.path('/addresses');
|
||||
}
|
||||
|
||||
controllerUtils.redirIfLogged();
|
||||
$scope.loading = false;
|
||||
|
||||
// QR code Scanner
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('OpenController',
|
||||
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, notification) {
|
||||
if ($rootScope.wallet) {
|
||||
$location.path('/addresses');
|
||||
}
|
||||
controllerUtils.redirIfLogged();
|
||||
|
||||
var cmp = function(o1, o2) {
|
||||
var v1 = o1.show.toLowerCase(),
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('SettingsController',
|
||||
function($scope, $rootScope, $window, $location) {
|
||||
if ($rootScope.wallet) {
|
||||
$location.path('/addresses');
|
||||
}
|
||||
|
||||
controllerUtils.redirIfLogged();
|
||||
$scope.title = 'Settings';
|
||||
$scope.networkName = config.networkName;
|
||||
$scope.insightHost = config.blockchain.host;
|
||||
|
|
|
@ -34,9 +34,7 @@ var valid_pairs = {
|
|||
|
||||
angular.module('copayApp.controllers').controller('SetupController',
|
||||
function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase, backupService, notification) {
|
||||
if ($rootScope.wallet) {
|
||||
$location.path('/addresses');
|
||||
}
|
||||
controllerUtils.redirIfLogged();
|
||||
|
||||
$rootScope.videoInfo = {};
|
||||
$scope.loading = false;
|
||||
|
|
|
@ -14,6 +14,13 @@ angular.module('copayApp.services')
|
|||
return vi.muted;
|
||||
};
|
||||
|
||||
root.redirIfLogged = function() {
|
||||
var w = $rootScope.wallet;
|
||||
if (w) {
|
||||
$location.path('addresses');
|
||||
}
|
||||
};
|
||||
|
||||
root.logout = function() {
|
||||
Socket.removeAllListeners();
|
||||
|
||||
|
|
Loading…
Reference in New Issue