forked from cory/tildefriends
Send followers/following information differently so that we load posts faster.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3727 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -267,8 +267,7 @@ async function refresh() {
|
||||
app.postMessage({connections: await ssb.connections()}),
|
||||
app.postMessage({apps: await core.apps()}),
|
||||
followingDeep(db, [whoami], 2).then(function(f) {
|
||||
return Promise.all([
|
||||
getRecentPostIds(db, whoami, [].concat([whoami], f), k_posts_max).then(async function(ids) {
|
||||
return getRecentPostIds(db, whoami, [].concat([whoami], f), k_posts_max).then(async function(ids) {
|
||||
return getPosts(db, ids);
|
||||
}).then(async function(posts) {
|
||||
var roots = posts.map(function(x) {
|
||||
@ -284,20 +283,20 @@ async function refresh() {
|
||||
return [].concat(posts, await getPosts(db, roots));
|
||||
}).then(function(posts) {
|
||||
return Promise.all(posts.map(x => app.postMessage({message: x})));
|
||||
}),
|
||||
Promise.all(f.map(function(id) {
|
||||
return Promise.all([
|
||||
getVotes(db, id).then(function(votes) {
|
||||
return app.postMessage({votes: votes});
|
||||
}),
|
||||
getAbout(db, id).then(function(user) {
|
||||
return app.postMessage({user: {user: id, about: user}});
|
||||
}),
|
||||
]);
|
||||
})),
|
||||
]);
|
||||
}).then(function() {
|
||||
return f.map(function(id) {
|
||||
return Promise.all([
|
||||
getVotes(db, id).then(function(votes) {
|
||||
return app.postMessage({votes: votes});
|
||||
}),
|
||||
getAbout(db, id).then(function(user) {
|
||||
return app.postMessage({user: {user: id, about: user}});
|
||||
}),
|
||||
sendUser(db, id),
|
||||
]);
|
||||
});
|
||||
});
|
||||
}),
|
||||
sendUser(db, whoami),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -321,8 +320,6 @@ core.register('message', async function(m) {
|
||||
await ssb.connect(m.message.connect);
|
||||
} else if (m.message.appendMessage) {
|
||||
await ssb.appendMessage(m.message.appendMessage);
|
||||
} else if (m.message.user) {
|
||||
await sendUser(await database("ssb"), m.message.user);
|
||||
} else if (m.message.refresh) {
|
||||
await refresh();
|
||||
}
|
||||
|
@ -7,9 +7,6 @@ Vue.component('tf-user', {
|
||||
edit_profile_description: null,
|
||||
} },
|
||||
props: ['id'],
|
||||
mounted: function() {
|
||||
window.parent.postMessage({user: this.id}, '*');
|
||||
},
|
||||
computed: {
|
||||
following: {
|
||||
get: function() {
|
||||
|
Reference in New Issue
Block a user