diff options
Diffstat (limited to 'js/app')
-rw-r--r-- | js/app/services/bl/feedbl.coffee | 1 | ||||
-rw-r--r-- | js/app/services/models/feedmodel.coffee | 8 | ||||
-rw-r--r-- | js/app/services/models/foldermodel.coffee | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/js/app/services/bl/feedbl.coffee b/js/app/services/bl/feedbl.coffee index f6bd804e5..ef4fbac1c 100644 --- a/js/app/services/bl/feedbl.coffee +++ b/js/app/services/bl/feedbl.coffee @@ -128,6 +128,7 @@ NewLoading, _ExistsError) -> create: (url, parentId=0, onSuccess=null, onFailure=null) -> onSuccess or= -> onFailure or= -> + parentId = parseInt(parentId, 10) if angular.isUndefined(url) or url.trim() == '' throw new Error() diff --git a/js/app/services/models/feedmodel.coffee b/js/app/services/models/feedmodel.coffee index b7e0a4361..5c4473b3a 100644 --- a/js/app/services/models/feedmodel.coffee +++ b/js/app/services/models/feedmodel.coffee @@ -59,7 +59,7 @@ angular.module('News').factory '_FeedModel', angular.isUndefined(item.id) if updateById or updateByUrlHash - @update(data) + @update(data, clearCache) else # if the item is not yet in the name cache it must be added @_urlHash[data.urlHash] = data @@ -71,6 +71,8 @@ angular.module('News').factory '_FeedModel', # if there is no id we just want it to appear in the list else @_data.push(data) + if clearCache + @_invalidateCache() update: (data, clearCache=true) -> @@ -129,7 +131,7 @@ angular.module('News').factory '_FeedModel', getFolderUnreadCount: (folderId) -> - query = new _EqualQuery('folderId', folderId) + query = new _EqualQuery('folderId', parseInt(folderId)) count = 0 for feed in @get(query) count += feed.unreadCount @@ -138,7 +140,7 @@ angular.module('News').factory '_FeedModel', getAllOfFolder: (folderId) -> - query = new _EqualQuery('folderId', folderId) + query = new _EqualQuery('folderId', parseInt(folderId)) return @get(query) diff --git a/js/app/services/models/foldermodel.coffee b/js/app/services/models/foldermodel.coffee index 647ec790f..eb1059fc8 100644 --- a/js/app/services/models/foldermodel.coffee +++ b/js/app/services/models/foldermodel.coffee @@ -50,7 +50,7 @@ angular.module('News').factory '_FolderModel', angular.isUndefined(item.id) if updateById or updateByName - @update(data) + @update(data, clearCache) else # if the item is not yet in the name cache it must be added @_nameCache[data.name] = data @@ -62,6 +62,8 @@ angular.module('News').factory '_FolderModel', # if there is no id we just want it to appear in the list else @_data.push(data) + if clearCache + @_invalidateCache() update: (data, clearCache=true) -> |