From a05b794090bc24e2097117fe6d8ba03105c38ed5 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Mon, 19 Dec 2022 15:17:46 -0500 Subject: [PATCH] Hide post contentMetaText when it is empty --- .../MastodonUI/View/Content/StatusView+ViewModel.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+ViewModel.swift b/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+ViewModel.swift index aae8e0b66..09d8b825f 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+ViewModel.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+ViewModel.swift @@ -314,16 +314,18 @@ extension StatusView.ViewModel { } statusView.contentMetaText.paragraphStyle = paragraphStyle - if let content = content { + if let content = content, !(content.string.isEmpty && content.entities.isEmpty) { statusView.contentMetaText.configure( content: content ) statusView.contentMetaText.textView.accessibilityTraits = [.staticText] statusView.contentMetaText.textView.accessibilityElementsHidden = false + statusView.contentMetaText.textView.isHidden = false } else { statusView.contentMetaText.reset() statusView.contentMetaText.textView.accessibilityLabel = "" + statusView.contentMetaText.textView.isHidden = true } statusView.contentMetaText.textView.alpha = isContentReveal ? 1 : 0 // keep the frame size and only display when revealing