Add support for loading more tweet replies

This commit is contained in:
Zed
2019-09-24 15:39:04 +02:00
parent 14e544500d
commit 9038645bc1
9 changed files with 44 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
import karax/[karaxdsl, vdom]
import ../types
import tweet
import ".."/[types, formatters]
import tweet, timeline
proc renderMoreReplies(thread: Thread): VNode =
let num = if thread.more != -1: $thread.more & " " else: ""
@@ -42,8 +42,14 @@ proc renderConversation*(conversation: Conversation; prefs: Prefs; path: string)
if more != 0:
renderMoreReplies(conversation.after)
if conversation.replies.len > 0:
if not conversation.replies.beginning:
renderNewer(Query(), getLink(conversation.tweet))
if conversation.replies.content.len > 0:
tdiv(class="replies"):
for thread in conversation.replies:
for thread in conversation.replies.content:
if thread == nil: continue
renderReplyThread(thread, prefs, path)
if conversation.replies.hasMore:
renderMore(Query(), conversation.replies.minId)