Minor retweet refactor

This commit is contained in:
Zed
2019-07-01 23:22:00 +02:00
parent 9b07199901
commit c60280415e
4 changed files with 12 additions and 7 deletions

View File

@@ -3,9 +3,9 @@
#import ../types, ../formatters, ../utils
#
#proc renderHeading(tweet: Tweet): string =
#if tweet.retweetBy.isSome:
#if tweet.retweet.isSome:
<div class="retweet">
<span>🔄 ${tweet.retweetBy.get()} retweeted</span>
<span>🔄 ${get(tweet.retweet).by} retweeted</span>
</div>
#end if
#if tweet.pinned:

View File

@@ -61,7 +61,7 @@
#
#for tweet in timeline.tweets:
#if tweet.id in retweets: continue
#elif tweet.retweetBy.isSome: retweets.add tweet.id
#elif tweet.retweet.isSome: retweets.add tweet.id
#end if
${renderTweet(tweet, "timeline-tweet")}
#end for