diff options
author | Asaad Mahmood <asaad@spinpunch.com> | 2016-03-08 15:07:43 +0500 |
---|---|---|
committer | Asaad Mahmood <asaad@spinpunch.com> | 2016-03-08 15:07:43 +0500 |
commit | cc453a048d50e57802bab9363b59c2189143b784 (patch) | |
tree | cbd409ec59ad48c40b84337db9a4cf3a063e4915 /web/react/components/create_post.jsx | |
parent | 81ccfca2bfc91779d7bf00dbccb6f932d285a87c (diff) | |
download | chat-cc453a048d50e57802bab9363b59c2189143b784.tar.gz chat-cc453a048d50e57802bab9363b59c2189143b784.tar.bz2 chat-cc453a048d50e57802bab9363b59c2189143b784.zip |
Multiple UI Improvements
Diffstat (limited to 'web/react/components/create_post.jsx')
-rw-r--r-- | web/react/components/create_post.jsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index 9d7a19554..62319b1a7 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -130,7 +130,7 @@ class CreatePost extends React.Component { post.message, false, (data) => { - PostStore.storeDraft(data.channel_id, null); + PostStore.storeDraft(this.state.channelId, null); this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null}); if (data.goto_location && data.goto_location.length > 0) { @@ -262,9 +262,7 @@ class CreatePost extends React.Component { message = err.message; } - if (clientId === -1) { - this.setState({serverError: message}); - } else { + if (clientId !== -1) { const draft = PostStore.getDraft(this.state.channelId); const index = draft.uploadsInProgress.indexOf(clientId); @@ -274,8 +272,10 @@ class CreatePost extends React.Component { PostStore.storeDraft(this.state.channelId, draft); - this.setState({uploadsInProgress: draft.uploadsInProgress, serverError: message}); + this.setState({uploadsInProgress: draft.uploadsInProgress}); } + + this.setState({serverError: message}); } removePreview(id) { const previews = Object.assign([], this.state.previews); |