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