X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fpost%2Fpost.tsx;h=a471e649139c368d10c570ebd2d5303f4ad2203c;hb=05aa483d899f83b231259fd0072c243c6567b922;hp=2c61f79e75815e17bcd4bd6f1ac3f8a5fdf027da;hpb=6126900bd54a302c871cc52f332a725fe159d04b;p=lemmy-ui.git diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx index 2c61f79..a471e64 100644 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@ -552,7 +552,6 @@ export class Post extends Component { community_view={res.data.community_view} moderators={res.data.moderators} admins={this.state.siteRes.admins} - online={res.data.online} enableNsfw={enableNsfw(this.state.siteRes)} showIcon allLanguages={this.state.siteRes.all_languages} @@ -729,19 +728,14 @@ export class Post extends Component { async handleBlockCommunity(form: BlockCommunity) { const blockCommunityRes = await HttpService.client.blockCommunity(form); - // TODO Probably isn't necessary - this.setState(s => { - if ( - s.postRes.state == "success" && - blockCommunityRes.state == "success" - ) { - s.postRes.data.community_view = blockCommunityRes.data.community_view; - } - return s; - }); - if (blockCommunityRes.state == "success") { updateCommunityBlock(blockCommunityRes.data); + this.setState(s => { + if (s.postRes.state == "success") { + s.postRes.data.community_view.blocked = + blockCommunityRes.data.blocked; + } + }); } }