From: Bill Erickson Date: Thu, 20 Aug 2015 02:22:00 +0000 (-0400) Subject: LP#1452950 reduce console errors on obscure dob check X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f8b9fbc203732300ba7bef3da3bf1eaac3f1cafd;p=evergreen%2Fequinox.git LP#1452950 reduce console errors on obscure dob check Avoid referencing egCore.env.* before env values have had time to arrive from the server. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index 1b8083966c..d5fb95d5c1 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -620,8 +620,14 @@ function($scope, $q, $location , $filter, egCore, egUser, patronSvc) { return !egCore.env.aous['circ.obscure_dob']; } - $scope.obscure_dob = function() { return egCore.env.aous['circ.obscure_dob']; } - $scope.now_show_dob = function() { return egCore.env.aous['circ.obscure_dob'] ? $scope.show_dob() : true; } + $scope.obscure_dob = function() { + return egCore.env.aous && egCore.env.aous['circ.obscure_dob']; + } + $scope.now_show_dob = function() { + return egCore.env.aous && egCore.env.aous['circ.obscure_dob'] ? + $scope.show_dob() : true; + } + $scope.patron = function() { return patronSvc.current } $scope.patron_stats = function() { return patronSvc.patron_stats } $scope.summary_stat_cats = function() { return patronSvc.summary_stat_cats }