handled unavailable in renderEmbeddedTweet

This commit is contained in:
Mitarashi 2022-01-14 19:17:10 +02:00
parent 0d3469df66
commit 3579bd8e30
1 changed files with 12 additions and 1 deletions

View File

@ -284,7 +284,18 @@ proc renderEmbeddedTweet*(tweet: Tweet; cfg: Config; prefs: Prefs; path: string)
tweet = tweet.retweet.get tweet = tweet.retweet.get
retweet = fullTweet.profile.fullname retweet = fullTweet.profile.fullname
# handle unavailable if not tweet.available:
return buildHtml(tdiv(class="unavailable timeline-item")):
tdiv(class="unavailable-box"):
if tweet.tombstone.len > 0:
text tweet.tombstone
elif tweet.text.len > 0:
text tweet.text
else:
text "This tweet is unavailable"
if tweet.quote.isSome:
renderQuote(tweet.quote.get(), prefs, path)
buildHtml(tdiv(class="timeline-item")): buildHtml(tdiv(class="timeline-item")):
renderHead(prefs, cfg) renderHead(prefs, cfg)