From e78bec84093f33506115f221cd5a1d421e09ff94 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 9 Oct 2022 19:15:41 -0400 Subject: [PATCH] Fix sensitive attachments not being hidden in new timeline --- .../Attachments/AttachmentsContainerView.swift | 14 +++++++++++--- Tusker/Views/Status/StatusCollectionViewCell.swift | 3 +-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Tusker/Views/Attachments/AttachmentsContainerView.swift b/Tusker/Views/Attachments/AttachmentsContainerView.swift index 0e425896ff..ae84c17063 100644 --- a/Tusker/Views/Attachments/AttachmentsContainerView.swift +++ b/Tusker/Views/Attachments/AttachmentsContainerView.swift @@ -33,9 +33,17 @@ class AttachmentsContainerView: UIView { } } - override func awakeFromNib() { - super.awakeFromNib() - + override init(frame: CGRect) { + super.init(frame: frame) + commonInit() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + commonInit() + } + + private func commonInit() { self.isUserInteractionEnabled = true self.layer.cornerRadius = 5 self.layer.masksToBounds = true diff --git a/Tusker/Views/Status/StatusCollectionViewCell.swift b/Tusker/Views/Status/StatusCollectionViewCell.swift index 2a95544f29..0c987fbde8 100644 --- a/Tusker/Views/Status/StatusCollectionViewCell.swift +++ b/Tusker/Views/Status/StatusCollectionViewCell.swift @@ -85,13 +85,12 @@ extension StatusCollectionViewCell { contentContainer.contentTextView.setTextFrom(status: status) contentContainer.attachmentsView.delegate = self + contentContainer.attachmentsView.updateUI(status: status) contentContainer.cardView.updateUI(status: status) contentContainer.cardView.isHidden = status.card == nil contentContainer.cardView.navigationDelegate = delegate contentContainer.cardView.actionProvider = delegate - contentContainer.attachmentsView.updateUI(status: status) - updateStatusState(status: status) contentWarningLabel.text = status.spoilerText