From: Mike Rylander Date: Fri, 4 May 2018 13:58:53 +0000 (-0400) Subject: LP#1755220: Return value checking in offline session fetch X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1ed3e20ba6884c38a0297ea6646746ebfa44ffb8;p=working%2FEvergreen.git LP#1755220: Return value checking in offline session fetch We need to make sure that we receive the correct shape of data (array) rather than that we simply got anything when fetching sessions. In the case of an expired session token, we'll receive an ILS Event object informing us of the expiration where we'd normally see a list of sessions. Signed-off-by: Mike Rylander Signed-off-by: Dawn Dale Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/web/js/ui/default/staff/offline.js b/Open-ILS/web/js/ui/default/staff/offline.js index 25046b8c04..fcf1a3d290 100644 --- a/Open-ILS/web/js/ui/default/staff/offline.js +++ b/Open-ILS/web/js/ui/default/staff/offline.js @@ -126,10 +126,11 @@ function($routeProvider , $locationProvider , $compileProvider) { }); } + $scope.sessions = []; $scope.refreshSessions = function () { return $http.get(formURL({action:'status',status_type:'sessions'})).then(function(res) { - if (res.data) { + if (angular.isArray(res.data)) { $scope.sessions = res.data; return $q.when(); }