LP#1642036 - Prevent race condition in Group Member Grid
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Thu, 26 Jul 2018 21:39:36 +0000 (17:39 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 9 Aug 2019 13:29:08 +0000 (09:29 -0400)
A timing condition was causing the setQuery() fnc to not
exist when called resulting in a blank group members grid.
A simple $timeout seems to address it.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

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

index 0d8f25f..fc5c8a2 100644 (file)
@@ -1085,6 +1085,11 @@ function($scope,  $routeParams , $q , $window , $timeout,  $location , egCore ,
         // grid query.
         if (redirect) return;
         // let initTab() fetch the user first so we can know the usrgroup
+
+        $timeout(grid.setQuery({
+            usrgroup : patronSvc.current.usrgroup(),
+            deleted : 'f'
+        }), 500); // wrap in timeout to try to prevent race condition LP1642036
         $scope.totals.owed = patronSvc.patron_stats.fines.group_balance_owed;
     });