From: Bill Erickson Date: Tue, 4 Sep 2018 19:09:31 +0000 (-0400) Subject: LP#1789747 More SharedWorker sanity checks for egLovefield X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=66f3d11420aabb06a2b12d9d8225912109aaa6ed;p=evergreen%2Ftadl.git LP#1789747 More SharedWorker sanity checks for egLovefield Signed-off-by: Bill Erickson Signed-off-by: Rogan Hamby Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/web/js/ui/default/staff/services/lovefield.js b/Open-ILS/web/js/ui/default/staff/services/lovefield.js index 707f41a15d..e7ec4960c8 100644 --- a/Open-ILS/web/js/ui/default/staff/services/lovefield.js +++ b/Open-ILS/web/js/ui/default/staff/services/lovefield.js @@ -240,8 +240,10 @@ angular.module('egCoreMod') } service.setStatCatsCache = function (statcats) { - if (lf.isOffline || !statcats || statcats.length === 0) + if (lf.isOffline || !statcats || + statcats.length === 0 || service.cannotConnect) { return $q.when(); + } var rows = statcats.map(function(cat) { return {id: cat.id(), value: egCore.idl.toHash(cat)} @@ -290,7 +292,7 @@ angular.module('egCoreMod') } service.setSettingsCache = function (settings) { - if (lf.isOffline) return $q.when(); + if (lf.isOffline || service.cannotConnect) return $q.when(); var rows = []; angular.forEach(settings, function (val, key) { @@ -334,7 +336,7 @@ angular.module('egCoreMod') } service.setListInOfflineCache = function (type, list) { - if (lf.isOffline) return $q.when(); + if (lf.isOffline || service.cannotConnect) return $q.when(); return service.isCacheGood(type).then(function(good) { if (good) { return }; // already cached