Fix reposts and likes on site. TODO: Fix missing avatars

This commit is contained in:
Lewis Dale 2023-10-10 07:29:28 +01:00
parent 38c568cc1a
commit 33db96ffec

View File

@ -49,10 +49,14 @@ class PostCache {
}
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 => {
console.log(comment.post);
if (this.posts[comment.post]) {
this.posts[comment.post].comments[comment.id] = comment;
}
@ -88,11 +92,11 @@ class PostCache {
}
}
const mapComment = comment => ({
const mapComment = comment => ({
author: {
name: comment.author_name,
avatars: comment.author_avatar_urls,
url: comment.meta.semantic_linkbacks_author_url,
url: comment.author_url,
},
content: comment.content.rendered,
canonical: comment.meta.url,