diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-03-07 17:17:02 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-03-07 17:17:02 -0500 |
commit | a980c0d7b3a1af6acb5def4ed39d4ff66830a4bf (patch) | |
tree | 0821b4300ee7a9dc802f100e8aba2d2d81b5cc8e /web/react/components/create_post.jsx | |
parent | 9d5e3e65b8423ddc144c8250357eb5ec1783587d (diff) | |
parent | 734387bdb9c732fc4c91e57c8a59a18db493224f (diff) | |
download | chat-a980c0d7b3a1af6acb5def4ed39d4ff66830a4bf.tar.gz chat-a980c0d7b3a1af6acb5def4ed39d4ff66830a4bf.tar.bz2 chat-a980c0d7b3a1af6acb5def4ed39d4ff66830a4bf.zip |
Merge pull request #2360 from hmhealey/plt1993
PLT-1993/PLT-1994 Stopped calling uploadFiles multiple times for a single upload
Diffstat (limited to 'web/react/components/create_post.jsx')
-rw-r--r-- | web/react/components/create_post.jsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index 9d7a19554..48d28ad6a 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -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); |