diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2022-06-14 17:07:35 +0300 |
---|---|---|
committer | blizzz (Rebase PR Action) <blizzz@users.noreply.github.com> | 2022-06-21 20:33:59 +0300 |
commit | 4cd8ad04067185a092bcc9d47176a89c94b649d6 (patch) | |
tree | 291e76ac0ecf6303b40cdd47b1949a3377385bd4 | |
parent | e7e782b8319fb18982e52ec33d9f2e58e636f6ef (diff) |
Fix default toast message for failed uploads with HTTP/2backport/32878/stable23
When an upload fails a toast is shown with either a specific message or
just the textual part of the HTTP error code (which comes from the
upload failure handler and set by "jQuery.ajax()". However, if there
is neither a message nor an error then the toast will show the default
message from the Toastify-js library, which is an undescriptive "Hi
there!".
When HTTP/2 is used Chromium does not provide the textual part of the
HTTP error code, so when an upload fails the toast can receive an empty
message and thus just show "Hi there!". Now an explicit message is
provided as a fallback to prevent that.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | apps/files/js/file-upload.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 9dec0de0846..209b39a2546 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -1134,7 +1134,7 @@ OC.Uploader.prototype = _.extend({ } } console.error(e, data, response) - OC.Notification.show(message || data.errorThrown, {type: 'error'}); + OC.Notification.show(message || data.errorThrown || t('files', 'File could not be uploaded'), {type: 'error'}); } if (upload) { |