diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-08-10 08:41:18 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-08-10 14:04:23 -0400 |
commit | 4e8af44370bfb4276e009526045a4983d5ff245a (patch) | |
tree | 901e39bc69433a9c77325923cfcb08da93ab3dd5 /web/react/utils/client.jsx | |
parent | 20d755f3dd5c797413177752884d8589c1f46931 (diff) | |
download | chat-4e8af44370bfb4276e009526045a4983d5ff245a.tar.gz chat-4e8af44370bfb4276e009526045a4983d5ff245a.tar.bz2 chat-4e8af44370bfb4276e009526045a4983d5ff245a.zip |
Added the ability to cancel file uploads on posts
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r-- | web/react/utils/client.jsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index b8eda0075..d979515ef 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -762,7 +762,7 @@ module.exports.getProfiles = function(success, error) { }; module.exports.uploadFile = function(formData, success, error) { - $.ajax({ + var request = $.ajax({ url: "/api/v1/files/upload", type: 'POST', data: formData, @@ -771,12 +771,16 @@ module.exports.uploadFile = function(formData, success, error) { processData: false, success: success, error: function(xhr, status, err) { - e = handleError("uploadFile", xhr, status, err); - error(e); + if (err !== 'abort') { + e = handleError("uploadFile", xhr, status, err); + error(e); + } } }); module.exports.track('api', 'api_files_upload'); + + return request; }; module.exports.getPublicLink = function(data, success, error) { |