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:
parent
b980bb4946
commit
4f1b31bce0
@ -1 +1 @@
|
|||||||
{"type":"tildefriends-app","files":{"app.js":"&Y/WR3FLnC1qV+3WGFKEaIZ4nrgKIa/flClu4wUI50R8=.sha256","index.html":"&mQ2fDeVm6D6+pwmF/6K04H1q5saq/Fl6Cq23UKlvJls=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&KmUw2D8yehJU95RQ+8DWP69w/5wK7yWR6fUc5/LIpio=.sha256","tf-message.js":"&c7NMlMBi2UZE7ChUXd3h4ih0q2myuHhp3PpNUfBRvHM=.sha256","tf.js":"&I45p0703bQNAWq/5wFHdVrwM3z+5FL4K8QmDTfSnBAU=.sha256","commonmark.min.js":"&5x6ek3tFrKTZX6hXNNyFsjmhvrjmWpUkwuuaiyVV1Us=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256"}}
|
{"type":"tildefriends-app","files":{"app.js":"&CuWFo7kEv6/qdqNl4gX1K9I+Hw7vnfp2RBndmqY4zhw=.sha256","index.html":"&mQ2fDeVm6D6+pwmF/6K04H1q5saq/Fl6Cq23UKlvJls=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&KmUw2D8yehJU95RQ+8DWP69w/5wK7yWR6fUc5/LIpio=.sha256","tf-message.js":"&c7NMlMBi2UZE7ChUXd3h4ih0q2myuHhp3PpNUfBRvHM=.sha256","tf.js":"&I45p0703bQNAWq/5wFHdVrwM3z+5FL4K8QmDTfSnBAU=.sha256","commonmark.min.js":"&5x6ek3tFrKTZX6hXNNyFsjmhvrjmWpUkwuuaiyVV1Us=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256"}}
|
@ -150,7 +150,7 @@ function fnv32a(value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getRecentPostIds(db, id, ids, limit) {
|
async function getRecentPostIds(db, id, ids, limit) {
|
||||||
const k_version = 10;
|
const k_version = 11;
|
||||||
const k_batch_max = 8;
|
const k_batch_max = 8;
|
||||||
var o = await db.get(id + ':recent_posts');
|
var o = await db.get(id + ':recent_posts');
|
||||||
var recent = [];
|
var recent = [];
|
||||||
@ -185,11 +185,9 @@ async function getRecentPostIds(db, id, ids, limit) {
|
|||||||
if (row.id) {
|
if (row.id) {
|
||||||
recent.push({id: row.id, timestamp: row.timestamp});
|
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 = [].concat(recent, f.recent);
|
||||||
f.recent.sort((x, y) => y.timestamp - x.timestamp);
|
f.recent.sort((x, y) => y.timestamp - x.timestamp);
|
||||||
f.recent = f.recent.slice(0, limit);
|
f.recent = f.recent.slice(0, limit);
|
||||||
|
Loading…
Reference in New Issue
Block a user