diff --git a/Mastodon/Protocol/StatusProvider/StatusProviderFacade.swift b/Mastodon/Protocol/StatusProvider/StatusProviderFacade.swift index b94391abe..d1c24c97f 100644 --- a/Mastodon/Protocol/StatusProvider/StatusProviderFacade.swift +++ b/Mastodon/Protocol/StatusProvider/StatusProviderFacade.swift @@ -67,7 +67,7 @@ extension StatusProviderFacade { static func responseToStatusActiveLabelAction(provider: StatusProvider, cell: UITableViewCell, activeLabel: ActiveLabel, didTapEntity entity: ActiveEntity) { switch entity.type { case .hashtag(let text, _): - let hashtagTimelienViewModel = HashtagTimelineViewModel(context: provider.context, hashTag: text) + let hashtagTimelienViewModel = HashtagTimelineViewModel(context: provider.context, hashtag: text) provider.coordinator.present(scene: .hashtagTimeline(viewModel: hashtagTimelienViewModel), from: provider, transition: .show) case .mention(let text, _): coordinateToStatusMentionProfileScene(for: .primary, provider: provider, cell: cell, mention: text) diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewController.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewController.swift index 9d638e6c6..a70fe7929 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewController.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewController.swift @@ -53,8 +53,8 @@ extension HashtagTimelineViewController { override func viewDidLoad() { super.viewDidLoad() - title = "#\(viewModel.hashTag)" - titleView.updateTitle(hashtag: viewModel.hashTag, peopleNumber: nil) + title = "#\(viewModel.hashtag)" + titleView.updateTitle(hashtag: viewModel.hashtag, peopleNumber: nil) navigationItem.titleView = titleView view.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color @@ -142,7 +142,7 @@ extension HashtagTimelineViewController { private func updatePromptTitle() { var subtitle: String? defer { - titleView.updateTitle(hashtag: viewModel.hashTag, peopleNumber: subtitle) + titleView.updateTitle(hashtag: viewModel.hashtag, peopleNumber: subtitle) } guard let histories = viewModel.hashtagEntity.value?.history else { return @@ -167,7 +167,7 @@ extension HashtagTimelineViewController { @objc private func composeBarButtonItemPressed(_ sender: UIBarButtonItem) { os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function) - let composeViewModel = ComposeViewModel(context: context, composeKind: .post, preInsertedContent: "#\(viewModel.hashTag)") + let composeViewModel = ComposeViewModel(context: context, composeKind: .post, preInsertedContent: "#\(viewModel.hashtag)") coordinator.present(scene: .compose(viewModel: composeViewModel), from: self, transition: .modal(animated: true, completion: nil)) } diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadLatestState.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadLatestState.swift index e772e8ea0..b2d121d50 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadLatestState.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadLatestState.swift @@ -50,7 +50,7 @@ extension HashtagTimelineViewModel.LoadLatestState { // TODO: only set large count when using Wi-Fi viewModel.context.apiService.hashtagTimeline( domain: activeMastodonAuthenticationBox.domain, - hashtag: viewModel.hashTag, + hashtag: viewModel.hashtag, authorizationBox: activeMastodonAuthenticationBox) .receive(on: DispatchQueue.main) .sink { completion in diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadMiddleState.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadMiddleState.swift index 9bf87554b..dcd3f81ac 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadMiddleState.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadMiddleState.swift @@ -67,7 +67,7 @@ extension HashtagTimelineViewModel.LoadMiddleState { viewModel.context.apiService.hashtagTimeline( domain: activeMastodonAuthenticationBox.domain, maxID: maxID, - hashtag: viewModel.hashTag, + hashtag: viewModel.hashtag, authorizationBox: activeMastodonAuthenticationBox) .delay(for: .seconds(1), scheduler: DispatchQueue.main) .receive(on: DispatchQueue.main) diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadOldestState.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadOldestState.swift index 23ec99152..d0607550e 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadOldestState.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel+LoadOldestState.swift @@ -58,7 +58,7 @@ extension HashtagTimelineViewModel.LoadOldestState { viewModel.context.apiService.hashtagTimeline( domain: activeMastodonAuthenticationBox.domain, maxID: maxID, - hashtag: viewModel.hashTag, + hashtag: viewModel.hashtag, authorizationBox: activeMastodonAuthenticationBox) .delay(for: .seconds(1), scheduler: DispatchQueue.main) .receive(on: DispatchQueue.main) diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel.swift index a6b1b0594..b43b67143 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewModel.swift @@ -15,7 +15,7 @@ import MastodonSDK final class HashtagTimelineViewModel: NSObject { - let hashTag: String + let hashtag: String var disposeBag = Set() @@ -65,9 +65,9 @@ final class HashtagTimelineViewModel: NSObject { var cellFrameCache = NSCache() - init(context: AppContext, hashTag: String) { + init(context: AppContext, hashtag: String) { self.context = context - self.hashTag = hashTag + self.hashtag = hashtag let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value self.fetchedResultsController = StatusFetchedResultsController(managedObjectContext: context.managedObjectContext, domain: activeMastodonAuthenticationBox?.domain, additionalTweetPredicate: nil) super.init() @@ -84,13 +84,13 @@ final class HashtagTimelineViewModel: NSObject { guard let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value else { return } - let query = Mastodon.API.Search.Query(q: hashTag, type: .hashtags) + let query = Mastodon.API.Search.Query(q: hashtag, type: .hashtags) context.apiService.search(domain: activeMastodonAuthenticationBox.domain, query: query, mastodonAuthenticationBox: activeMastodonAuthenticationBox) .sink { _ in } receiveValue: { [weak self] response in let matchedTag = response.value.hashtags.first { tag -> Bool in - return tag.name == self?.hashTag + return tag.name == self?.hashtag } self?.hashtagEntity.send(matchedTag) }