From 001e118ee30f249a4337bfc2fd68fc2a801c5e61 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 7 Jul 2017 12:33:17 -0400 Subject: [PATCH] offline: Avoid saving unnecessary/loop-y lists for offline Signed-off-by: Mike Rylander --- Open-ILS/web/js/ui/default/staff/services/env.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/env.js b/Open-ILS/web/js/ui/default/staff/services/env.js index 413c44d5db..4fe755a209 100644 --- a/Open-ILS/web/js/ui/default/staff/services/env.js +++ b/Open-ILS/web/js/ui/default/staff/services/env.js @@ -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); }); -- 2.11.0