summaryrefslogtreecommitdiffstats
path: root/ui/src/components/create-post.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-03-27 09:59:21 -0700
committerDessalines <tyhou13@gmx.com>2019-03-27 09:59:21 -0700
commit2bb2b8473771168f16495beafb82d50913df2b1d (patch)
tree63485f7ce17504aee7be8f1c2f1bdc4e9605b3db /ui/src/components/create-post.tsx
parent25dcb8f4f4f80e401d1d3154923e2dcd05664c76 (diff)
New comments tree mostly working.
- Fixed some bugs w/ the websocket service
Diffstat (limited to 'ui/src/components/create-post.tsx')
-rw-r--r--ui/src/components/create-post.tsx5
1 files changed, 1 insertions, 4 deletions
diff --git a/ui/src/components/create-post.tsx b/ui/src/components/create-post.tsx
index 9ddf8c97..3d5dceda 100644
--- a/ui/src/components/create-post.tsx
+++ b/ui/src/components/create-post.tsx
@@ -105,22 +105,18 @@ export class CreatePost extends Component<any, State> {
handlePostUrlChange(i: CreatePost, event) {
i.state.postForm.url = event.target.value;
- i.setState(i.state);
}
handlePostNameChange(i: CreatePost, event) {
i.state.postForm.name = event.target.value;
- i.setState(i.state);
}
handlePostBodyChange(i: CreatePost, event) {
i.state.postForm.body = event.target.value;
- i.setState(i.state);
}
handlePostCommunityChange(i: CreatePost, event) {
i.state.postForm.community_id = Number(event.target.value);
- i.setState(i.state);
}
parseMessage(msg: any) {
@@ -132,6 +128,7 @@ export class CreatePost extends Component<any, State> {
} else if (op == UserOperation.ListCommunities) {
let res: ListCommunitiesResponse = msg;
this.state.communities = res.communities;
+ this.state.postForm.community_id = res.communities[0].id; // TODO set it to the default community
this.setState(this.state);
} else if (op == UserOperation.CreatePost) {
let res: PostResponse = msg;