Possibly fix crash when reblogger account is cached
This commit is contained in:
parent
85812d774d
commit
975fb23292
|
@ -112,10 +112,7 @@ class StatusTableViewCell: UITableViewCell {
|
|||
rebloggerAccountUpdater = MastodonCache.accountSubject
|
||||
.filter { $0.id == self.rebloggerID }
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(receiveValue: { (_) in
|
||||
// this method is responsible for setting the reblog label text
|
||||
self.updateUIForPreferences()
|
||||
})
|
||||
.sink(receiveValue: updateRebloggerLabel(reblogger:))
|
||||
}
|
||||
|
||||
func updateUI(statusID: String) {
|
||||
|
@ -194,11 +191,15 @@ class StatusTableViewCell: UITableViewCell {
|
|||
avatarImageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadius(for: avatarImageView)
|
||||
if let rebloggerID = rebloggerID,
|
||||
let reblogger = MastodonCache.account(for: rebloggerID) {
|
||||
reblogLabel.text = "Reblogged by \(reblogger.realDisplayName)"
|
||||
updateRebloggerLabel(reblogger: reblogger)
|
||||
}
|
||||
displayNameLabel.text = account.realDisplayName
|
||||
}
|
||||
|
||||
func updateRebloggerLabel(reblogger: Account) {
|
||||
reblogLabel.text = "Reblogged by \(reblogger.realDisplayName)"
|
||||
}
|
||||
|
||||
func updateTimestamp() {
|
||||
guard let status = MastodonCache.status(for: statusID) else { fatalError("Missing cached status \(statusID!)") }
|
||||
|
||||
|
|
Loading…
Reference in New Issue