From c930b7c448fd394e9f12a82728f4fe4202879974 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 20 Dec 2013 23:25:00 +0100 Subject: debug --- js/app/services/persistence.coffee | 8 +++++--- js/public/app.js | 6 ++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/app/services/persistence.coffee b/js/app/services/persistence.coffee index 9aba6c777..a79dc1224 100644 --- a/js/app/services/persistence.coffee +++ b/js/app/services/persistence.coffee @@ -70,7 +70,6 @@ $rootScope, $q) -> # autopage prevention @_lastFeedChange = new Date().getTime() @_preventUselessAutoPageRequest = false - console.log 'free' else loading = @_autoPageLoading @@ -87,7 +86,6 @@ $rootScope, $q) -> lastChange == @_lastFeedChange && offset != 0 @_preventUselessAutoPageRequest = true - console.log 'lock' onSuccess(data) loading.decrease() failureCallbackWrapper = (data) -> @@ -103,10 +101,14 @@ $rootScope, $q) -> onFailure: failureCallbackWrapper if not @_preventUselessAutoPageRequest - console.log 'request' @_request.get 'news_items', params else + # this case happens if an autopage request is prevented if when + # there are no new items. we still have to remove the loading + # sign and call the success handler, otherwise the controller + # will block the request and the loading sign will not go away onSuccess() + loading.decrease() getNewItems: (type, id, lastModified, onSuccess) -> diff --git a/js/public/app.js b/js/public/app.js index c5488daed..5306dd0d8 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -2775,7 +2775,6 @@ License along with this library. If not, see . loading = this._feedLoading; this._lastFeedChange = new Date().getTime(); this._preventUselessAutoPageRequest = false; - console.log('free'); } else { loading = this._autoPageLoading; } @@ -2786,7 +2785,6 @@ License along with this library. If not, see . return successCallbackWrapper = function(data) { if (data.data.items.length === 0 && lastChange === _this._lastFeedChange && offset !== 0) { _this._preventUselessAutoPageRequest = true; - console.log('lock'); } onSuccess(data); return loading.decrease(); @@ -2806,10 +2804,10 @@ License along with this library. If not, see . onFailure: failureCallbackWrapper }; if (!this._preventUselessAutoPageRequest) { - console.log('request'); return this._request.get('news_items', params); } else { - return onSuccess(); + onSuccess(); + return loading.decrease(); } }; -- cgit v1.2.3