Commit 0b0ff084 authored by yPhil's avatar yPhil
Browse files

Saving lastItem in the datastore

parent 9c5bb9dc
......@@ -550,7 +550,6 @@ PTL.feed = {
var saved = localStorage.getItem(feedUrl);
if (saved) {
console.log('YOZ: %s (%s)');
$feedBody.append(saved);
$refreshButton
......@@ -581,7 +580,8 @@ PTL.feed = {
}
if (data.lastItem) {
$dataStore.data('lastitem', data.lastItem);
console.log('YEP: %s (%s)', data.lastItem);
$dataStore.attr('data-lastitem', data.lastItem);
}
$feedLink.text(feedTitle)
......
......@@ -98,7 +98,6 @@
id="feedLimitSpinner"
name="value">
</div>
</fieldset>
<legend data-content="Delete"
......
......@@ -76,10 +76,10 @@ function getFeed (feedUrl, lastItem, callback) {
}
if (item.link !== lastItem) {
console.error('### PUSHING: #%s GUID: %s', i, lastItem);
console.error('### PUSHING: #%s GUID: %s', i, newLastItem);
feedItems.push(item);
} else {
console.error('### Count reached i:%s, lastItem: [%s]', i, lastItem);
console.error('### Count reached i:%s, lastItem: [%s], newLastItem: %s', i, lastItem, newLastItem);
this.resume();
}
......@@ -93,7 +93,7 @@ function getFeed (feedUrl, lastItem, callback) {
}).on ('end', function () {
var meta = this.meta;
resolve();
return callback (null, feedItems, meta.title || 'Untitled', meta.link || feedUrl, lastItem);
return callback (null, feedItems, meta.title || 'Untitled', meta.link || feedUrl, newLastItem);
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment