chore: make status name label sync set

This commit is contained in:
CMK 2021-07-07 12:10:02 +08:00
parent 0646b6eb99
commit d7d39d1bac
1 changed files with 2 additions and 14 deletions

View File

@ -519,13 +519,7 @@ extension StatusSection {
let name = author.displayName.isEmpty ? author.username : author.displayName
return L10n.Common.Controls.Status.userRepliedTo(name)
}()
MastodonStatusContent.parseResult(content: headerText, emojiDict: status.replyTo?.author.emojiDict ?? [:])
.receive(on: DispatchQueue.main)
.sink { [weak cell] parseResult in
guard let cell = cell else { return }
cell.statusView.headerInfoLabel.configure(contentParseResult: parseResult)
}
.store(in: &cell.disposeBag)
cell.statusView.headerInfoLabel.configure(content: headerText, emojiDict: status.replyTo?.author.emojiDict ?? [:])
cell.statusView.headerInfoLabel.accessibilityLabel = headerText
cell.statusView.headerInfoLabel.isAccessibilityElement = status.replyTo != nil
} else {
@ -541,13 +535,7 @@ extension StatusSection {
// name
let author = (status.reblog ?? status).author
let nameContent = author.displayNameWithFallback
MastodonStatusContent.parseResult(content: nameContent, emojiDict: author.emojiDict)
.receive(on: DispatchQueue.main)
.sink { [weak cell] parseResult in
guard let cell = cell else { return }
cell.statusView.nameLabel.configure(contentParseResult: parseResult)
}
.store(in: &cell.disposeBag)
cell.statusView.nameLabel.configure(content: nameContent, emojiDict: author.emojiDict)
cell.statusView.nameLabel.accessibilityLabel = nameContent
// username
cell.statusView.usernameLabel.text = "@" + author.acct