From 7bfa23e2b1314229a270493d91eb911af4003c8d Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 11 Apr 2018 12:16:44 +0200 Subject: [PATCH] Prevent email hash change listener to kick-in on view change --- src/views/email.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/email.js b/src/views/email.js index b7226e007..47ee5fd23 100644 --- a/src/views/email.js +++ b/src/views/email.js @@ -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 () {