X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fpost%2Fpost.tsx;h=7eff1b4a4496d2e7115be1851df6e8de4aac59db;hb=4d716e039b8b96e6f4296f7e1ba7ae25d578741e;hp=501c06dcb675011132bf4a05181e72ef0e766483;hpb=71336002e7276698088d3fa1c6b3e9808983cbc8;p=lemmy-ui.git diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx index 501c06d..7eff1b4 100644 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@ -557,7 +557,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} @@ -734,19 +733,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; + } + }); } }