|
@@ -152,6 +152,25 @@ class CommunityFollowViewController: BaseViewController {
|
|
|
self?.tableView.reloadData()
|
|
|
}
|
|
|
|
|
|
+ observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("isCommnetLikeApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
|
|
|
+ let followStatusModel = notification.object as? FollowStatusModel
|
|
|
+ if !(self?.communityFollowDataModels?.isEmpty ?? true) {
|
|
|
+ for communityRecommendDataModel in (self?.communityFollowDataModels)! {
|
|
|
+ if communityRecommendDataModel.relateData?.id == followStatusModel?.postId {
|
|
|
+ if !(communityRecommendDataModel.relateData?.postComment?.isEmpty ?? true ){
|
|
|
+ for communityFollowPostCommentModel in (communityRecommendDataModel.relateData?.postComment)!{
|
|
|
+ if communityFollowPostCommentModel.id == followStatusModel?.commnetId {
|
|
|
+ communityFollowPostCommentModel.isLike = followStatusModel?.isFollowStatus
|
|
|
+ communityFollowPostCommentModel.likeCount = followStatusModel?.commentLikeCount
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ self?.tableView.reloadData()
|
|
|
+ }
|
|
|
+
|
|
|
observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("communityDeletePostApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
|
|
|
let postId = notification.object as? Int
|
|
|
if !(self?.communityFollowDataModels?.isEmpty ?? true) {
|