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>
Thu, 31 Jan 2019 14:36:01 +0000 (09:36 -0500)
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 a6131de..24aa858 100644 (file)
@@ -1077,10 +1077,10 @@ function($scope,  $routeParams , $q , $window , $timeout,  $location , egCore ,
         if (redirect) return;
         // let initTab() fetch the user first so we can know the usrgroup
 
-        grid.setQuery({
+        $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;
     });