Simple fixes
This commit is contained in:
parent
5b0e5f51db
commit
6659b938b5
4 changed files with 10 additions and 26 deletions
|
|
@ -4,6 +4,8 @@ angular.module('copayApp.controllers').controller('HeadController', function($sc
|
|||
$scope.username = $rootScope.iden.getName();
|
||||
$scope.hoverMenu = false;
|
||||
|
||||
var isChromeApp = typeof window !== "undefined" && window.chrome && chrome.runtime && chrome.runtime.id;
|
||||
|
||||
$scope.hoverIn = function() {
|
||||
this.hoverMenu = true;
|
||||
};
|
||||
|
|
@ -31,15 +33,15 @@ angular.module('copayApp.controllers').controller('HeadController', function($sc
|
|||
};
|
||||
|
||||
|
||||
//mpando restore after solve some chrome app error
|
||||
// Ensures a graceful disconnect
|
||||
// window.onbeforeunload = function() {
|
||||
// $scope.signout();
|
||||
// };
|
||||
//Ensures a graceful disconnect
|
||||
window.onbeforeunload = function() {
|
||||
$scope.signout();
|
||||
};
|
||||
|
||||
// $scope.$on('$destroy', function() {
|
||||
// window.onbeforeunload = undefined;
|
||||
// });
|
||||
$scope.$on('$destroy', function() {
|
||||
if (isChromeApp) return;
|
||||
window.onbeforeunload = undefined;
|
||||
});
|
||||
|
||||
$scope.init = function() {
|
||||
if (!$rootScope.wallet) return;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,6 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('UnsupportedController',
|
||||
function($scope, $location) {
|
||||
|
||||
var localStorage;
|
||||
if (window.chrome && chrome.runtime && chrome.runtime.id) {
|
||||
localStorage = chrome.storage.local;
|
||||
} else {
|
||||
localStorage = window.localStorage;
|
||||
}
|
||||
if (localStorage && localStorage.length > 0) {
|
||||
$location.path('/');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue