Show new posts at the top of the list.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3704 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2021-12-27 20:24:14 +00:00
parent 3cddc524d1
commit 5fbe9c42bc
3 changed files with 13 additions and 2 deletions

View File

@@ -291,6 +291,14 @@ async function refresh() {
]);
}
ssb.addEventListener('message', async function(id) {
var db = await database("ssb");
var posts = await getPosts(db, [id]);
for (let post of posts) {
await app.postMessage({message: post});
}
});
core.register('message', async function(m) {
if (m.message == 'ready') {
await ready();