diff options
Diffstat (limited to 'app/javascript/flavours/glitch/util')
-rw-r--r-- | app/javascript/flavours/glitch/util/hashtag.js | 4 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/util/resize_image.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/util/hashtag.js b/app/javascript/flavours/glitch/util/hashtag.js index d5ea57662..9b663487f 100644 --- a/app/javascript/flavours/glitch/util/hashtag.js +++ b/app/javascript/flavours/glitch/util/hashtag.js @@ -2,7 +2,7 @@ export function recoverHashtags (recognizedTags, text) { return recognizedTags.map(tag => { const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i'); const matched_hashtag = text.match(re); - return matched_hashtag ? matched_hashtag[1] : tag; + return matched_hashtag ? matched_hashtag[1] : null; } - ); + ).filter(x => x !== null); } diff --git a/app/javascript/flavours/glitch/util/resize_image.js b/app/javascript/flavours/glitch/util/resize_image.js index d1608094f..bbdbc865e 100644 --- a/app/javascript/flavours/glitch/util/resize_image.js +++ b/app/javascript/flavours/glitch/util/resize_image.js @@ -31,7 +31,7 @@ const loadImage = inputFile => new Promise((resolve, reject) => { }); const getOrientation = (img, type = 'image/png') => new Promise(resolve => { - if (type !== 'image/jpeg') { + if (!['image/jpeg', 'image/webp'].includes(type)) { resolve(1); return; } |