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=ebfc001e4cf704ba882ec06c7a4fc7dac677b9aa;p=working%2FEvergreen.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 --- 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 ff79a10a23..117d8f8516 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 @@ -630,8 +630,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 }