Fix crash when trying to restore activity for non-pinned timeline

This commit is contained in:
Shadowfacts 2023-01-09 12:39:35 -04:00
parent cce6413e2b
commit 2ed8d22899
1 changed files with 4 additions and 1 deletions

View File

@ -95,8 +95,11 @@ class TimelinesPageViewController: SegmentedPageViewController<TimelinesPageView
return return
} }
let page = Page(mastodonController: mastodonController, timeline: timeline) let page = Page(mastodonController: mastodonController, timeline: timeline)
// the pinned timelines may have changed after an iCloud sync, in which case don't restore anything
if pages.contains(page) {
selectPage(page, animated: false) selectPage(page, animated: false)
} }
}
@objc private func customizePressed() { @objc private func customizePressed() {
present(UIHostingController(rootView: CustomizeTimelinesView(mastodonController: mastodonController)), animated: true) present(UIHostingController(rootView: CustomizeTimelinesView(mastodonController: mastodonController)), animated: true)