about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-04-25 12:27:29 +0200
committerThibaut Girka <thib@sitedethib.com>2020-04-25 15:29:01 +0200
commit9d41a410a38549f9d07e550b8cda7460b423cb6b (patch)
tree1a79819019d47e81085941b7698e480bad79ed67
parent572e89e56323e2f398ea5a168caf3d8b7e3e46b8 (diff)
[Glitch] Fix uninformative error message when uploading unsupported image files
Port be637146f310d7ec3a49d01e850959514e9e4964 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
-rw-r--r--app/javascript/flavours/glitch/util/resize_image.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/util/resize_image.js b/app/javascript/flavours/glitch/util/resize_image.js
index 61f924f70..8c89b2841 100644
--- a/app/javascript/flavours/glitch/util/resize_image.js
+++ b/app/javascript/flavours/glitch/util/resize_image.js
@@ -138,7 +138,7 @@ const resizeImage = (img, type = 'image/png') => new Promise((resolve, reject) =
     .catch(reject);
 });
 
-export default inputFile => new Promise((resolve, reject) => {
+export default inputFile => new Promise((resolve) => {
   if (!inputFile.type.match(/image.*/) || inputFile.type === 'image/gif') {
     resolve(inputFile);
     return;
@@ -153,5 +153,5 @@ export default inputFile => new Promise((resolve, reject) => {
     resizeImage(img, inputFile.type)
       .then(resolve)
       .catch(() => resolve(inputFile));
-  }).catch(reject);
+  }).catch(() => resolve(inputFile));
 });