diff --git a/mixins/ThreadLink.pixy b/mixins/ThreadLink.pixy index 25c6b8c9..3aa4fae5 100644 --- a/mixins/ThreadLink.pixy +++ b/mixins/ThreadLink.pixy @@ -8,6 +8,6 @@ component ThreadLink(thread *arn.Thread) Icon("thumb-tack") a.thread-link-title(href="/thread/" + thread.ID)= thread.Title .spacer - .thread-reply-count= len(thread.Posts) + .thread-reply-count= len(thread.PostIDs) .thread-icons Icon(arn.GetForumIcon(thread.Tags[0])) \ No newline at end of file diff --git a/pages/thread/thread.go b/pages/thread/thread.go index 14945c5a..b37d25e9 100644 --- a/pages/thread/thread.go +++ b/pages/thread/thread.go @@ -22,12 +22,7 @@ func Get(ctx *aero.Context) string { } // Fetch posts - postObjects := arn.DB.GetMany("Post", thread.Posts) - posts := make([]*arn.Post, len(postObjects)) - - for i, obj := range postObjects { - posts[i] = obj.(*arn.Post) - } + posts := thread.Posts() // Sort posts arn.SortPostsLatestLast(posts) diff --git a/scripts/Actions/Forum.ts b/scripts/Actions/Forum.ts index 959aafd5..47f5fd04 100644 --- a/scripts/Actions/Forum.ts +++ b/scripts/Actions/Forum.ts @@ -63,7 +63,8 @@ export function forumReply(arn: AnimeNotifier) { let post = { text: textarea.value, - threadId: thread.dataset.id, + parentId: thread.dataset.id, + parentType: "Thread", tags: [] }