fix unconditional email receipt button
authorGalen Charlton <gmc@esilibrary.com>
Mon, 8 Aug 2016 21:13:59 +0000 (17:13 -0400)
committerEquinox Support <esi@dev-test2.esilibrary.com>
Mon, 8 Aug 2016 21:13:59 +0000 (17:13 -0400)
Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js

index b7f9490..3f82de7 100644 (file)
@@ -46,6 +46,7 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
 
     $scope.has_email_address = function() {
         return (
+            patronSvc.current &&
             patronSvc.current.email() &&
             patronSvc.current.email().match(/.*@.*/).length
         );
@@ -219,7 +220,7 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
     }
 
     $scope.email_receipt = function() {
-        if ($scope.may_email_receipt() && $scope.checkouts.length) {
+        if ($scope.has_email_address() && $scope.checkouts.length) {
             return egCore.net.request(
                 'open-ils.circ',
                 'open-ils.circ.checkout.batch_notify.session.atomic',