Fix "Show thread" not being shown, link to thread

This commit is contained in:
Zed 2019-10-23 09:47:15 +02:00
parent 813cfefbb4
commit de8fe659ff
2 changed files with 5 additions and 4 deletions

View File

@ -38,9 +38,10 @@ proc renderToTop(): VNode =
proc renderThread(thread: seq[Tweet]; prefs: Prefs; path: string): VNode = proc renderThread(thread: seq[Tweet]; prefs: Prefs; path: string): VNode =
buildHtml(tdiv(class="thread-line")): buildHtml(tdiv(class="thread-line")):
for i, threadTweet in thread.sortedByIt(it.id): let sortedThread = thread.sortedByIt(it.id)
let show = i == thread.len and thread[0].id != threadTweet.threadId for i, tweet in sortedThread:
renderTweet(threadTweet, prefs, path, class="thread", let show = i == thread.high and sortedThread[0].id != tweet.threadId
renderTweet(tweet, prefs, path, class="thread",
index=i, total=thread.high, showThread=show) index=i, total=thread.high, showThread=show)
proc threadFilter(it: Tweet; thread: int): bool = proc threadFilter(it: Tweet; thread: int): bool =

View File

@ -272,5 +272,5 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class="";
renderStats(tweet.stats, views) renderStats(tweet.stats, views)
if showThread: if showThread:
a(class="show-thread", href=getLink(tweet)): a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
text "Show this thread" text "Show this thread"