offline: Avoid saving unnecessary/loop-y lists for offline
authorMike Rylander <mrylander@gmail.com>
Fri, 7 Jul 2017 16:33:17 +0000 (12:33 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 7 Jul 2017 16:33:17 +0000 (12:33 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/services/env.js

index 413c44d..4fe755a 100644 (file)
@@ -51,7 +51,15 @@ function($q,  $window , $injector , egAuth,  egPCRUD,  egIDL) {
 
     var service = {
         // collection of custom loader functions
-        loaders : []
+        loaders : [],
+
+        // Add class hints to this list when offline does not need them and
+        // if they cause "Maximum call stack size exceeded" console errors.
+        // If offline does need a list that causes problems, a custom loader
+        // will be necessary.
+        // We'll start with authority-related classes causing problems in the
+        // staff catalog.
+        ignoreOffline : ['at','acs','abaafm','aba','acsbf','acsaf']
     };
 
 
@@ -122,10 +130,11 @@ function($q,  $window , $injector , egAuth,  egPCRUD,  egIDL) {
             blob = {list : list, map : {}};
         }
 
-        if (!noOffline) {
+        if (!noOffline && service.ignoreOffline.indexOf(class_) < 0) {
             if (!egLovefield) {
                 egLovefield = $injector.get('egLovefield');
             }
+            console.debug('About to cache a list of ' + class_ + ' objects...');
             egLovefield.isCacheGood(class_).then(function(good) {
                 if (!good) egLovefield.setListInOfflineCache(class_, blob.list);
             });