chore: correct hashtag typo
This commit is contained in:
parent
fbe3a8c419
commit
ecd595c6e8
|
@ -67,7 +67,7 @@ extension StatusProviderFacade {
|
||||||
static func responseToStatusActiveLabelAction(provider: StatusProvider, cell: UITableViewCell, activeLabel: ActiveLabel, didTapEntity entity: ActiveEntity) {
|
static func responseToStatusActiveLabelAction(provider: StatusProvider, cell: UITableViewCell, activeLabel: ActiveLabel, didTapEntity entity: ActiveEntity) {
|
||||||
switch entity.type {
|
switch entity.type {
|
||||||
case .hashtag(let text, _):
|
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)
|
provider.coordinator.present(scene: .hashtagTimeline(viewModel: hashtagTimelienViewModel), from: provider, transition: .show)
|
||||||
case .mention(let text, _):
|
case .mention(let text, _):
|
||||||
coordinateToStatusMentionProfileScene(for: .primary, provider: provider, cell: cell, mention: text)
|
coordinateToStatusMentionProfileScene(for: .primary, provider: provider, cell: cell, mention: text)
|
||||||
|
|
|
@ -53,8 +53,8 @@ extension HashtagTimelineViewController {
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
title = "#\(viewModel.hashTag)"
|
title = "#\(viewModel.hashtag)"
|
||||||
titleView.updateTitle(hashtag: viewModel.hashTag, peopleNumber: nil)
|
titleView.updateTitle(hashtag: viewModel.hashtag, peopleNumber: nil)
|
||||||
navigationItem.titleView = titleView
|
navigationItem.titleView = titleView
|
||||||
|
|
||||||
view.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color
|
view.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color
|
||||||
|
@ -142,7 +142,7 @@ extension HashtagTimelineViewController {
|
||||||
private func updatePromptTitle() {
|
private func updatePromptTitle() {
|
||||||
var subtitle: String?
|
var subtitle: String?
|
||||||
defer {
|
defer {
|
||||||
titleView.updateTitle(hashtag: viewModel.hashTag, peopleNumber: subtitle)
|
titleView.updateTitle(hashtag: viewModel.hashtag, peopleNumber: subtitle)
|
||||||
}
|
}
|
||||||
guard let histories = viewModel.hashtagEntity.value?.history else {
|
guard let histories = viewModel.hashtagEntity.value?.history else {
|
||||||
return
|
return
|
||||||
|
@ -167,7 +167,7 @@ extension HashtagTimelineViewController {
|
||||||
|
|
||||||
@objc private func composeBarButtonItemPressed(_ sender: UIBarButtonItem) {
|
@objc private func composeBarButtonItemPressed(_ sender: UIBarButtonItem) {
|
||||||
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
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))
|
coordinator.present(scene: .compose(viewModel: composeViewModel), from: self, transition: .modal(animated: true, completion: nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ extension HashtagTimelineViewModel.LoadLatestState {
|
||||||
// TODO: only set large count when using Wi-Fi
|
// TODO: only set large count when using Wi-Fi
|
||||||
viewModel.context.apiService.hashtagTimeline(
|
viewModel.context.apiService.hashtagTimeline(
|
||||||
domain: activeMastodonAuthenticationBox.domain,
|
domain: activeMastodonAuthenticationBox.domain,
|
||||||
hashtag: viewModel.hashTag,
|
hashtag: viewModel.hashtag,
|
||||||
authorizationBox: activeMastodonAuthenticationBox)
|
authorizationBox: activeMastodonAuthenticationBox)
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
.sink { completion in
|
.sink { completion in
|
||||||
|
|
|
@ -67,7 +67,7 @@ extension HashtagTimelineViewModel.LoadMiddleState {
|
||||||
viewModel.context.apiService.hashtagTimeline(
|
viewModel.context.apiService.hashtagTimeline(
|
||||||
domain: activeMastodonAuthenticationBox.domain,
|
domain: activeMastodonAuthenticationBox.domain,
|
||||||
maxID: maxID,
|
maxID: maxID,
|
||||||
hashtag: viewModel.hashTag,
|
hashtag: viewModel.hashtag,
|
||||||
authorizationBox: activeMastodonAuthenticationBox)
|
authorizationBox: activeMastodonAuthenticationBox)
|
||||||
.delay(for: .seconds(1), scheduler: DispatchQueue.main)
|
.delay(for: .seconds(1), scheduler: DispatchQueue.main)
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
|
|
|
@ -58,7 +58,7 @@ extension HashtagTimelineViewModel.LoadOldestState {
|
||||||
viewModel.context.apiService.hashtagTimeline(
|
viewModel.context.apiService.hashtagTimeline(
|
||||||
domain: activeMastodonAuthenticationBox.domain,
|
domain: activeMastodonAuthenticationBox.domain,
|
||||||
maxID: maxID,
|
maxID: maxID,
|
||||||
hashtag: viewModel.hashTag,
|
hashtag: viewModel.hashtag,
|
||||||
authorizationBox: activeMastodonAuthenticationBox)
|
authorizationBox: activeMastodonAuthenticationBox)
|
||||||
.delay(for: .seconds(1), scheduler: DispatchQueue.main)
|
.delay(for: .seconds(1), scheduler: DispatchQueue.main)
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
|
|
|
@ -15,7 +15,7 @@ import MastodonSDK
|
||||||
|
|
||||||
final class HashtagTimelineViewModel: NSObject {
|
final class HashtagTimelineViewModel: NSObject {
|
||||||
|
|
||||||
let hashTag: String
|
let hashtag: String
|
||||||
|
|
||||||
var disposeBag = Set<AnyCancellable>()
|
var disposeBag = Set<AnyCancellable>()
|
||||||
|
|
||||||
|
@ -65,9 +65,9 @@ final class HashtagTimelineViewModel: NSObject {
|
||||||
var cellFrameCache = NSCache<NSNumber, NSValue>()
|
var cellFrameCache = NSCache<NSNumber, NSValue>()
|
||||||
|
|
||||||
|
|
||||||
init(context: AppContext, hashTag: String) {
|
init(context: AppContext, hashtag: String) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.hashTag = hashTag
|
self.hashtag = hashtag
|
||||||
let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value
|
let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value
|
||||||
self.fetchedResultsController = StatusFetchedResultsController(managedObjectContext: context.managedObjectContext, domain: activeMastodonAuthenticationBox?.domain, additionalTweetPredicate: nil)
|
self.fetchedResultsController = StatusFetchedResultsController(managedObjectContext: context.managedObjectContext, domain: activeMastodonAuthenticationBox?.domain, additionalTweetPredicate: nil)
|
||||||
super.init()
|
super.init()
|
||||||
|
@ -84,13 +84,13 @@ final class HashtagTimelineViewModel: NSObject {
|
||||||
guard let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value else {
|
guard let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value else {
|
||||||
return
|
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)
|
context.apiService.search(domain: activeMastodonAuthenticationBox.domain, query: query, mastodonAuthenticationBox: activeMastodonAuthenticationBox)
|
||||||
.sink { _ in
|
.sink { _ in
|
||||||
|
|
||||||
} receiveValue: { [weak self] response in
|
} receiveValue: { [weak self] response in
|
||||||
let matchedTag = response.value.hashtags.first { tag -> Bool in
|
let matchedTag = response.value.hashtags.first { tag -> Bool in
|
||||||
return tag.name == self?.hashTag
|
return tag.name == self?.hashtag
|
||||||
}
|
}
|
||||||
self?.hashtagEntity.send(matchedTag)
|
self?.hashtagEntity.send(matchedTag)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue