Fix reposts and likes on site. TODO: Fix missing avatars
This commit is contained in:
parent
38c568cc1a
commit
33db96ffec
@ -49,10 +49,14 @@ class PostCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fetchComments() {
|
async fetchComments() {
|
||||||
const comments = [...await this.fetchCommentsByType(), ...await this.fetchCommentsByType("webmention")];
|
const likes = await this.fetchCommentsByType("like");
|
||||||
|
const mentions = await this.fetchCommentsByType();
|
||||||
|
const reposts = await this.fetchCommentsByType("repost");
|
||||||
|
|
||||||
|
const comments = [...likes, ...mentions, ...reposts];
|
||||||
|
console.log(reposts[0]);
|
||||||
|
|
||||||
comments.forEach(comment => {
|
comments.forEach(comment => {
|
||||||
console.log(comment.post);
|
|
||||||
if (this.posts[comment.post]) {
|
if (this.posts[comment.post]) {
|
||||||
this.posts[comment.post].comments[comment.id] = comment;
|
this.posts[comment.post].comments[comment.id] = comment;
|
||||||
}
|
}
|
||||||
@ -88,11 +92,11 @@ class PostCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapComment = comment => ({
|
const mapComment = comment => ({
|
||||||
author: {
|
author: {
|
||||||
name: comment.author_name,
|
name: comment.author_name,
|
||||||
avatars: comment.author_avatar_urls,
|
avatars: comment.author_avatar_urls,
|
||||||
url: comment.meta.semantic_linkbacks_author_url,
|
url: comment.author_url,
|
||||||
},
|
},
|
||||||
content: comment.content.rendered,
|
content: comment.content.rendered,
|
||||||
canonical: comment.meta.url,
|
canonical: comment.meta.url,
|
||||||
|
Loading…
Reference in New Issue
Block a user