Working single post rendering
This commit is contained in:
@@ -172,9 +172,17 @@ export class App {
|
||||
for (let userID of userIDs) {
|
||||
// console.log.apply(null, log(`[app] announceUsers, got user:${userID} from peer ${sendingPeerID}`));
|
||||
this.sync.addUserPeer(userID, sendingPeerID);
|
||||
if (!(this.sync.shouldSyncUserID(userID) || (this.router.route & (App.Route.USER | App.Route.POST) && userID === this.router.userID))) {
|
||||
console.log.apply(null, log(`[app] announceUser_rpc_response skipping user[${logID(userID)}] from[${logID(sendingPeerID)}]`));
|
||||
continue;
|
||||
const isUserOrPostRoute = (this.router.route & (App.Route.USER | App.Route.POST)) !== 0;
|
||||
if (isUserOrPostRoute) {
|
||||
if (userID !== this.router.userID) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!this.sync.shouldSyncUserID(userID)) {
|
||||
console.log.apply(null, log(`[app] announceUser_rpc_response skipping user[${logID(userID)}] from[${logID(sendingPeerID)}]`));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
console.log.apply(null, log(`[app] calling getPostIDsForUser for user [${logID(userID)}] on peer [${logID(sendingPeerID)}]`));
|
||||
this.statusBar.updatePeerStatus(sendingPeerID, `getPostIDs(${logID(userID)})⬆️`);
|
||||
@@ -809,7 +817,8 @@ export class App {
|
||||
this.timerStart();
|
||||
let posts = [];
|
||||
if (postID) {
|
||||
posts = await getPostForUser(userID, postID);
|
||||
const post = await getPostForUser(userID, postID);
|
||||
posts = post ? [post] : [];
|
||||
}
|
||||
else {
|
||||
posts = await getData(userID, new Date(2022, 8), new Date());
|
||||
|
||||
Reference in New Issue
Block a user