fix: fix crash when unfollowing , fix cell reuse issue

This commit is contained in:
sunxiaojian 2021-04-09 20:04:12 +08:00
parent 567c2af0ee
commit aa23ce398f
2 changed files with 2 additions and 1 deletions

View File

@ -75,6 +75,7 @@ class SearchRecommendAccountsCollectionViewCell: UICollectionViewCell {
headerImageView.af.cancelImageRequest() headerImageView.af.cancelImageRequest()
avatarImageView.af.cancelImageRequest() avatarImageView.af.cancelImageRequest()
visualEffectView.removeFromSuperview() visualEffectView.removeFromSuperview()
disposeBag.removeAll()
} }
override init(frame: CGRect) { override init(frame: CGRect) {

View File

@ -24,7 +24,7 @@ extension SearchViewController: SearchRecommendAccountsCollectionViewCellDelegat
guard let currentMastodonUser = viewModel.currentMastodonUser.value else { guard let currentMastodonUser = viewModel.currentMastodonUser.value else {
return return
} }
let relationshipAction = relationShipActionSet(mastodonUser: clickedUser, currentMastodonUser: currentMastodonUser) guard let relationshipAction = relationShipActionSet(mastodonUser: clickedUser, currentMastodonUser: currentMastodonUser).highPriorityAction(except: .editOptions) else { return }
switch relationshipAction { switch relationshipAction {
case .none: case .none:
break break