From 2e92d55b64d538eef0f14cad550b04ea574f08a0 Mon Sep 17 00:00:00 2001 From: ThibG Date: Sat, 25 Apr 2020 12:27:29 +0200 Subject: [PATCH] [Glitch] Fix uninformative error message when uploading unsupported image files Port cd3a0a17bc1f5c5b095ff4aa6102bc27eb9c7791 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/util/resize_image.js | 4 ++-- 1 file 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 61f924f70c..8c89b2841a 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)); });