From 37b9673b128ae597fdc01df0fdb60df8c32201dc Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 21 Aug 2024 16:17:57 -0400 Subject: [PATCH] Fix list timeline no content view being added repetedly on refresh --- Tusker/Screens/Lists/ListTimelineViewController.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tusker/Screens/Lists/ListTimelineViewController.swift b/Tusker/Screens/Lists/ListTimelineViewController.swift index 678f2fc6e7..b18eda7da9 100644 --- a/Tusker/Screens/Lists/ListTimelineViewController.swift +++ b/Tusker/Screens/Lists/ListTimelineViewController.swift @@ -56,6 +56,10 @@ class ListTimelineViewController: TimelineViewController { } private func createNoContentView() { + guard noContentView == nil else { + return + } + let title = UILabel() title.textColor = .secondaryLabel title.font = .preferredFont(forTextStyle: .title1).withTraits(.traitBold)! @@ -133,6 +137,9 @@ class ListTimelineViewController: TimelineViewController { override func handleReplaceAllItems(_ timelineItems: [String]) async { if timelineItems.isEmpty { createNoContentView() + } else { + noContentView?.removeFromSuperview() + noContentView = nil } await super.handleReplaceAllItems(timelineItems) }