From 104981f3d388637013d641d5d32bf7448dad093f Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 25 Feb 2023 18:30:05 -0500 Subject: [PATCH] Fix iPad Explore screen not restoring search state --- .../Screens/Explore/InlineTrendsViewController.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tusker/Screens/Explore/InlineTrendsViewController.swift b/Tusker/Screens/Explore/InlineTrendsViewController.swift index 819b1454..9f6340b4 100644 --- a/Tusker/Screens/Explore/InlineTrendsViewController.swift +++ b/Tusker/Screens/Explore/InlineTrendsViewController.swift @@ -77,3 +77,13 @@ class InlineTrendsViewController: UIViewController { } } + +extension InlineTrendsViewController: StateRestorableViewController { + func stateRestorationActivity() -> NSUserActivity? { + if searchController.isActive { + return UserActivityManager.searchActivity(query: searchController.searchBar.text, accountID: mastodonController.accountInfo!.id) + } else { + return nil + } + } +}