LP1774268: Tidy up hold notification testing
authorJason Boyer <JBoyer@eoli.info>
Wed, 1 Apr 2020 12:57:53 +0000 (08:57 -0400)
committerJason Boyer <JBoyer@eoli.info>
Wed, 1 Apr 2020 13:18:51 +0000 (09:18 -0400)
Signed-off-by: Jason Boyer <JBoyer@eoli.info>

Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js

index b3a5cda..4a340bd 100644 (file)
@@ -1897,16 +1897,13 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
     function extract_hold_notify() {
         var p = $scope.patron;
         var notify = $scope.user_settings['opac.hold_notify'];
-        if (notify === '') {
-           $scope.hold_notify_type.phone = false;
-           $scope.hold_notify_type.email = false;
-           return;
-        }
-        if (!notify) {
-           $scope.hold_notify_type.phone = true;
-           $scope.hold_notify_type.email = true;
-           return;
+
+        if (!notify && !(notify === '')) {
+            $scope.hold_notify_type.phone = true;
+            $scope.hold_notify_type.email = true;
+            return;
         }
+
         $scope.hold_notify_type.phone = Boolean(notify.match(/phone/));
         $scope.hold_notify_type.email = Boolean(notify.match(/email/));
         $scope.hold_notify_type.sms = Boolean(notify.match(/sms/));