forked from cory/tildefriends
Oof, fixed an issue getting recent posts.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3724 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -150,7 +150,7 @@ function fnv32a(value)
|
||||
}
|
||||
|
||||
async function getRecentPostIds(db, id, ids, limit) {
|
||||
const k_version = 10;
|
||||
const k_version = 11;
|
||||
const k_batch_max = 8;
|
||||
var o = await db.get(id + ':recent_posts');
|
||||
var recent = [];
|
||||
@ -185,11 +185,9 @@ async function getRecentPostIds(db, id, ids, limit) {
|
||||
if (row.id) {
|
||||
recent.push({id: row.id, timestamp: row.timestamp});
|
||||
}
|
||||
if (row.rowid) {
|
||||
f.rowid = Math.max(row.rowid, f.rowid);
|
||||
}
|
||||
});
|
||||
}
|
||||
f.rowid = row_id_max;
|
||||
f.recent = [].concat(recent, f.recent);
|
||||
f.recent.sort((x, y) => y.timestamp - x.timestamp);
|
||||
f.recent = f.recent.slice(0, limit);
|
||||
|
Reference in New Issue
Block a user