Prevent email hash change listener to kick-in on view change

This commit is contained in:
Johannes Zellner
2018-04-11 12:16:44 +02:00
parent bcd55972cd
commit 7bfa23e2b1

View File

@@ -589,7 +589,8 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
});
function hashChangeListener() {
if (!$scope.ready) return;
// prevent the change listener to handle the change if it does not belong to this view. The eventhandler will be subsequently removed
if (!$scope.ready || !$location.path().startsWith('/email/')) return;
// event listener is called from DOM not angular, need to use $apply
$scope.$apply(function () {