From 7e625f74d2709c546a400fa309fcd70002f2cec4 Mon Sep 17 00:00:00 2001 From: CMK Date: Wed, 24 Feb 2021 16:18:39 +0800 Subject: [PATCH] fix: content warning label set when spoiler text is empty issue --- Mastodon/Diffiable/Section/StatusSection.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Mastodon/Diffiable/Section/StatusSection.swift b/Mastodon/Diffiable/Section/StatusSection.swift index 3030c140c..4cc19bdc3 100644 --- a/Mastodon/Diffiable/Section/StatusSection.swift +++ b/Mastodon/Diffiable/Section/StatusSection.swift @@ -98,6 +98,7 @@ extension StatusSection { let isStatusTextSensitive = statusContentWarningAttribute?.isStatusTextSensitive ?? (toot.reblog ?? toot).sensitive cell.statusView.updateContentWarningDisplay(isHidden: !isStatusTextSensitive) cell.statusView.contentWarningTitle.text = (toot.reblog ?? toot).spoilerText.flatMap { spoilerText in + guard !spoilerText.isEmpty else { return nil } return L10n.Common.Controls.Status.contentWarning + ": \(spoilerText)" } ?? L10n.Common.Controls.Status.contentWarning