diff --git a/src/formatters.nim b/src/formatters.nim index fdd3a8d..36bedeb 100644 --- a/src/formatters.nim +++ b/src/formatters.nim @@ -131,6 +131,7 @@ proc getRfc822Time*(tweet: Tweet): string = tweet.time.format("ddd', 'd MMM yyyy HH:mm:ss 'GMT'") proc getLink*(tweet: Tweet | Quote): string = + if tweet.id.len == 0: return &"/{tweet.profile.username}/status/{tweet.id}" proc getTombstone*(text: string): string = diff --git a/src/views/status.nim b/src/views/status.nim index 5041fa4..882cc13 100644 --- a/src/views/status.nim +++ b/src/views/status.nim @@ -6,9 +6,14 @@ import tweet, timeline proc renderMoreReplies(thread: Thread): VNode = let num = if thread.more != -1: $thread.more & " " else: "" let reply = if thread.more == 1: "reply" else: "replies" + let link = getLink(thread.content[0]) buildHtml(tdiv(class="timeline-item more-replies")): - a(class="more-replies-text", href=getLink(thread.content[0])): - text $num & "more " & reply + if link.len > 0: + a(class="more-replies-text", href=getLink(thread.content[0])): + text $num & "more " & reply + else: + a(class="more-replies-text"): + text $num & "more " & reply proc renderReplyThread(thread: Thread; prefs: Prefs; path: string): VNode = buildHtml(tdiv(class="reply thread thread-line")):