Now with fewer dupe messages.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3739 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-01-08 00:15:09 +00:00
parent 1cf55d7d64
commit 50d860183d
2 changed files with 3 additions and 3 deletions

View File

@ -279,8 +279,8 @@ async function refresh(selected) {
return null;
}
});
var have = posts.map(x => x.id);
roots = [...new Set(roots)].filter(x => x && !have[x]);
var have = new Set(posts.map(x => x.id));
roots = [...new Set(roots)].filter(x => x && !have.has(x));
var all_posts = [].concat(posts, await getPosts(db, roots));
return Promise.all(all_posts.map(x => app.postMessage({message: x})));
}),