import {
AddModToCommunityResponse,
BanFromCommunityResponse,
+ BlockPersonResponse,
CommentResponse,
CommentView,
CommunityResponse,
setOptionalAuth,
setupTippy,
toast,
+ updatePersonBlock,
wsClient,
wsJsonToRes,
wsSubscribe,
let sort: SortType = pathSplit[6]
? SortType[pathSplit[6]]
- : UserService.Instance.localUserView
+ : UserService.Instance.myUserInfo
? Object.values(SortType)[
- UserService.Instance.localUserView.local_user.default_sort_type
+ UserService.Instance.myUserInfo.local_user_view.local_user
+ .default_sort_type
]
: SortType.Active;
} else if (op == UserOperation.CreatePost) {
let data = wsJsonToRes<PostResponse>(msg).data;
this.state.posts.unshift(data.post_view);
- if (UserService.Instance.localUserView?.local_user.show_new_post_notifs) {
+ if (
+ UserService.Instance.myUserInfo?.local_user_view.local_user
+ .show_new_post_notifs
+ ) {
notifyPost(data.post_view, this.context.router);
}
this.setState(this.state);
let data = wsJsonToRes<CommentResponse>(msg).data;
createCommentLikeRes(data.comment_view, this.state.comments);
this.setState(this.state);
+ } else if (op == UserOperation.BlockPerson) {
+ let data = wsJsonToRes<BlockPersonResponse>(msg).data;
+ updatePersonBlock(data);
}
}
}