Simplify sendUser.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3731 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-01-03 01:30:53 +00:00
parent df5dfa1539
commit e1448a1c3a
2 changed files with 9 additions and 15 deletions

View File

@ -81,17 +81,6 @@ async function followers(db, id) {
return results;
}
async function sendUser(db, id) {
return Promise.all([
following(db, id).then(async function(following) {
return app.postMessage({following: {id: id, users: following}});
}),
followers(db, id).then(async function(followers) {
return app.postMessage({followers: {id: id, users: followers}});
}),
]);
}
async function getAbout(db, id) {
var o = await db.get(id + ":about");
const k_version = 4;
@ -284,7 +273,7 @@ async function refresh() {
}).then(function(posts) {
return Promise.all(posts.map(x => app.postMessage({message: x})));
}).then(function() {
return f.map(function(id) {
return Promise.all(f.map(function(id) {
return Promise.all([
getVotes(db, id).then(function(votes) {
return app.postMessage({votes: votes});
@ -292,9 +281,14 @@ async function refresh() {
getAbout(db, id).then(function(user) {
return app.postMessage({user: {user: id, about: user}});
}),
sendUser(db, id),
following(db, id).then(function(following) {
return app.postMessage({following: {id: id, users: following}});
}),
followers(db, id).then(function(followers) {
return app.postMessage({followers: {id: id, users: followers}});
}),
]);
});
}));
});
}),
]);