From a90643552a9f44b0342d18494c2fbb7c281829ec Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 23 Feb 2021 15:23:18 +0800 Subject: [PATCH] feat: display count for reply button --- Mastodon/Diffiable/Section/TimelineSection.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Mastodon/Diffiable/Section/TimelineSection.swift b/Mastodon/Diffiable/Section/TimelineSection.swift index 97ca559f6..2585f93e8 100644 --- a/Mastodon/Diffiable/Section/TimelineSection.swift +++ b/Mastodon/Diffiable/Section/TimelineSection.swift @@ -86,6 +86,12 @@ extension TimelineSection { cell.statusView.activeTextLabel.config(content: (toot.reblog ?? toot).content) // toolbar + let replyCountTitle: String = { + let count = (toot.reblog ?? toot).repliesCount?.intValue ?? 0 + return TimelineSection.formattedNumberTitleForActionButton(count) + }() + cell.statusView.actionToolbarContainer.replyButton.setTitle(replyCountTitle, for: .normal) + let isLike = (toot.reblog ?? toot).favouritedBy.flatMap { $0.contains(where: { $0.id == requestUserID }) } ?? false let favoriteCountTitle: String = { let count = (toot.reblog ?? toot).favouritesCount.intValue