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