From: Bill Erickson Date: Thu, 9 Nov 2017 16:39:12 +0000 (-0500) Subject: Avoid PhantomJS BroadcastChannel failure X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Fbroadcast-channel-phantom-fix;p=working%2FEvergreen.git Avoid PhantomJS BroadcastChannel failure Current version of PhantomJS used for unit tests, etc. does not recognize the relatively new BroadcastChannel object. Avoid trying to create such a channel when the executing code does not recognize it. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/staff/services/auth.js b/Open-ILS/web/js/ui/default/staff/services/auth.js index 8912c78a4b..ec8300579c 100644 --- a/Open-ILS/web/js/ui/default/staff/services/auth.js +++ b/Open-ILS/web/js/ui/default/staff/services/auth.js @@ -53,7 +53,10 @@ function($q , $timeout , $rootScope , $window , $location , egNet , egHatch) { }, // Listen for logout events in other tabs - authChannel : new BroadcastChannel('eg.auth') + // Current version of phantomjs (unit tests, etc.) does not + // support BroadcastChannel, so just dummy it up. + authChannel : (typeof BroadcastChannel == 'undefined') ? + {} : new BroadcastChannel('eg.auth') }; /* Returns a promise, which is resolved if valid