summaryrefslogtreecommitdiffstats
path: root/web/react/utils/client.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-11 12:08:08 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-11 12:08:08 -0400
commit4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e (patch)
treefd5e1948bc5f24cd8711a7a6681b142745228025 /web/react/utils/client.jsx
parentd72d356cbcb027df8b2fcd3c84e26b64119e6b5c (diff)
parent17b05f705f910429ece1ca6c64ec56bf89dd014b (diff)
downloadchat-4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e.tar.gz
chat-4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e.tar.bz2
chat-4c7cdb20f074e2c06a08cd64a57060b8e8b64d2e.zip
Merge pull request #359 from hmhealey/mm1770
MM-1770 Add the ability to cancel in-progress file uploads
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r--web/react/utils/client.jsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index 3375da7cf..6a1f7c820 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -754,7 +754,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,
@@ -763,12 +763,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) {