Add missing # symbol (IOS-287)

This commit is contained in:
Marcus Kida 2024-07-24 14:36:00 +02:00
parent cd4ef9f31c
commit bff3afb3a4
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
3 changed files with 6 additions and 5 deletions

View File

@ -202,12 +202,13 @@ final class HomeTimelineViewController: UIViewController, NeedsDependency, Media
).singleOutput().value) ?? []
var listEntries = lists.map { entry in
return LabeledAction(title: entry.name, image: nil, handler: { [weak self] in
let entryName = "#\(entry.name)"
return LabeledAction(title: entryName, image: nil, handler: { [weak self] in
guard let self, let viewModel = self.viewModel else { return }
viewModel.timelineContext = .hashtag(entry.name)
viewModel.loadLatestStateMachine.enter(HomeTimelineViewModel.LoadLatestState.ContextSwitch.self)
timelineSelectorButton.setAttributedTitle(
.init(string: entry.name, attributes: [
.init(string: entryName, attributes: [
.font: UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 20, weight: .semibold))
]),
for: .normal)

View File

@ -23,7 +23,7 @@ class HashtagIntentHandler: INExtension, HashtagIntentHandling {
.search(query: .init(q: searchTerm, type: .hashtags), authenticationBox: authenticationBox)
.value
.hashtags
.compactMap { $0.name as NSString }
.compactMap { "#\($0.name)" as NSString }
results = searchResults
@ -33,7 +33,7 @@ class HashtagIntentHandler: INExtension, HashtagIntentHandling {
query: Mastodon.API.Account.FollowedTagsQuery(limit: nil),
authenticationBox: authenticationBox)
.value
.compactMap { $0.name as NSString }
.compactMap { "#\($0.name)" as NSString }
results = followedTags

View File

@ -43,7 +43,7 @@ extension HashtagWidgetProvider {
let desiredHashtag: String
if let hashtag = configuration.hashtag {
desiredHashtag = hashtag
desiredHashtag = hashtag.replacingOccurrences(of: "#", with: "")
} else {
return completion(.notFound("hashtag"))
}