From e4532aa1cb19decb5f57fca13ca20aae3e1e0a1e Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 25 Apr 2019 14:52:18 -0700 Subject: Adding /f/ and /u/ in links now. - Fixes #102 --- ui/src/components/community.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'ui/src/components/community.tsx') diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx index f521d518..ba542582 100644 --- a/ui/src/components/community.tsx +++ b/ui/src/components/community.tsx @@ -10,6 +10,7 @@ import { msgOp } from '../utils'; interface State { community: CommunityI; communityId: number; + communityName: string; moderators: Array; admins: Array; loading: boolean; @@ -36,6 +37,7 @@ export class Community extends Component { moderators: [], admins: [], communityId: Number(this.props.match.params.id), + communityName: this.props.match.params.name, loading: true } @@ -52,7 +54,12 @@ export class Community extends Component { () => console.log('complete') ); - WebSocketService.Instance.getCommunity(this.state.communityId); + if (this.state.communityId) { + WebSocketService.Instance.getCommunity(this.state.communityId); + } else if (this.state.communityName) { + WebSocketService.Instance.getCommunityByName(this.state.communityName); + } + } componentWillUnmount() { @@ -71,7 +78,7 @@ export class Community extends Component { removed } - + {this.state.community && }