forked from shadowfacts/Tusker
Fix crash if status for leaked collection view cell updates
This commit is contained in:
parent
bf6dfab121
commit
59231e513f
|
@ -60,7 +60,8 @@ extension StatusCollectionViewCell {
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
.filter { [unowned self] in $0 == self.statusID }
|
.filter { [unowned self] in $0 == self.statusID }
|
||||||
.sink { [unowned self] _ in
|
.sink { [unowned self] _ in
|
||||||
if let status = self.mastodonController.persistentContainer.status(for: self.statusID) {
|
if let mastodonController = self.mastodonController,
|
||||||
|
let status = mastodonController.persistentContainer.status(for: self.statusID) {
|
||||||
// update immediately w/o animation
|
// update immediately w/o animation
|
||||||
self.favoriteButton.active = status.favourited
|
self.favoriteButton.active = status.favourited
|
||||||
self.reblogButton.active = status.reblogged
|
self.reblogButton.active = status.reblogged
|
||||||
|
|
Loading…
Reference in New Issue