diff options
author | Dessalines <tyhou13@gmx.com> | 2020-07-08 01:02:14 -0400 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-07-08 01:02:14 -0400 |
commit | cd4e0ab3c2cfd615e4771fb9181a31ce237b5ceb (patch) | |
tree | 699dd63cd3ad7601e49a1173884506e3638ae37a /ui/src/components/community-form.tsx | |
parent | 8fda7d00d5ec9e415b44aa10cff3c4d735563a20 (diff) |
HTML title bugs.
- Fixing HTML titles for some pages. Fixes #801
- Removing WebSocketService.Instance.site, fetching site on demand now.
Diffstat (limited to 'ui/src/components/community-form.tsx')
-rw-r--r-- | ui/src/components/community-form.tsx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx index 90e12738..46d62ef5 100644 --- a/ui/src/components/community-form.tsx +++ b/ui/src/components/community-form.tsx @@ -8,7 +8,6 @@ import { Category, ListCategoriesResponse, CommunityResponse, - GetSiteResponse, WebSocketJsonResponse, } from '../interfaces'; import { WebSocketService } from '../services'; @@ -30,13 +29,13 @@ interface CommunityFormProps { onCancel?(): any; onCreate?(community: Community): any; onEdit?(community: Community): any; + enableNsfw: boolean; } interface CommunityFormState { communityForm: CommunityFormI; categories: Array<Category>; loading: boolean; - enable_nsfw: boolean; } export class CommunityForm extends Component< @@ -56,7 +55,6 @@ export class CommunityForm extends Component< }, categories: [], loading: false, - enable_nsfw: null, }; constructor(props: any, context: any) { @@ -86,7 +84,6 @@ export class CommunityForm extends Component< ); WebSocketService.Instance.listCategories(); - WebSocketService.Instance.getSite(); } componentDidMount() { @@ -187,7 +184,7 @@ export class CommunityForm extends Component< </div> </div> - {this.state.enable_nsfw && ( + {this.props.enableNsfw && ( <div class="form-group row"> <div class="col-12"> <div class="form-check"> @@ -303,10 +300,6 @@ export class CommunityForm extends Component< let data = res.data as CommunityResponse; this.state.loading = false; this.props.onEdit(data.community); - } else if (res.op == UserOperation.GetSite) { - let data = res.data as GetSiteResponse; - this.state.enable_nsfw = data.site.enable_nsfw; - this.setState(this.state); } } } |