diff --git a/Tusker/Screens/Explore/AddSavedHashtagViewController.swift b/Tusker/Screens/Explore/AddSavedHashtagViewController.swift index 265a754bc7..2892fb91a3 100644 --- a/Tusker/Screens/Explore/AddSavedHashtagViewController.swift +++ b/Tusker/Screens/Explore/AddSavedHashtagViewController.swift @@ -84,7 +84,7 @@ class AddSavedHashtagViewController: UIViewController { navigationItem.searchController = searchController navigationItem.hidesSearchBarWhenScrolling = false - navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelButtonPressed)) + navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneButtonPressed)) } override func viewWillAppear(_ animated: Bool) { @@ -107,15 +107,12 @@ class AddSavedHashtagViewController: UIViewController { } private func selectHashtag(_ hashtag: Hashtag) { - let context = mastodonController.persistentContainer.viewContext - _ = SavedHashtag(hashtag: hashtag, context: context) - try! context.save() - presentingViewController!.dismiss(animated: true) + show(HashtagTimelineViewController(for: hashtag, mastodonController: mastodonController), sender: nil) } // MARK: - Interaction - @objc func cancelButtonPressed() { + @objc func doneButtonPressed() { dismiss(animated: true) } @@ -128,11 +125,6 @@ extension AddSavedHashtagViewController { enum Item: Hashable { case tag(Hashtag) } -// class DataSource: UITableViewDiffableDataSource { -// override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { -// return -// } -// } } extension AddSavedHashtagViewController: UICollectionViewDelegate { diff --git a/Tusker/Screens/Explore/ExploreViewController.swift b/Tusker/Screens/Explore/ExploreViewController.swift index 82e3323d09..4bdceaebf6 100644 --- a/Tusker/Screens/Explore/ExploreViewController.swift +++ b/Tusker/Screens/Explore/ExploreViewController.swift @@ -437,7 +437,7 @@ extension ExploreViewController { case let .savedHashtag(hashtag): return hashtag.name case .addSavedHashtag: - return NSLocalizedString("Save Hashtag...", comment: "save hashtag nav item title") + return NSLocalizedString("Add Hashtag...", comment: "save hashtag nav item title") case let .savedInstance(url): return url.host! case .findInstance: