diff options
author | Dessalines <tyhou13@gmx.com> | 2019-03-24 20:51:27 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-03-24 20:51:27 -0700 |
commit | e1cb805cfc719d6266ec50e5f1ef3ac1edf74656 (patch) | |
tree | fd4114f7019ad934ae21dfad15c11412c3994335 /ui/src/components/create-community.tsx | |
parent | e570c70701e1c66dad12bef76821f6d94c717a02 (diff) |
Refactoring websocket code, adding create community
- Adding create community
Diffstat (limited to 'ui/src/components/create-community.tsx')
-rw-r--r-- | ui/src/components/create-community.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/src/components/create-community.tsx b/ui/src/components/create-community.tsx index dbacd18d..159147b6 100644 --- a/ui/src/components/create-community.tsx +++ b/ui/src/components/create-community.tsx @@ -5,6 +5,8 @@ import { CommunityForm, UserOperation } from '../interfaces'; import { WebSocketService, UserService } from '../services'; import { msgOp } from '../utils'; +import { Community } from '../interfaces'; + interface State { communityForm: CommunityForm; } @@ -28,6 +30,7 @@ export class CreateCommunity extends Component<any, State> { .subscribe( (msg) => this.parseMessage(msg), (err) => console.error(err), + () => console.log("complete") ); } @@ -80,10 +83,14 @@ export class CreateCommunity extends Component<any, State> { parseMessage(msg: any) { let op: UserOperation = msgOp(msg); + console.log(msg); if (msg.error) { alert(msg.error); return; } else { + if (op == UserOperation.CreateCommunity) { + let community: Community = msg.data; + } } } |