From 60bdccc0b5ea00ffe8a2c0250c43a8dce5319667 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 9 Jul 2021 17:02:04 -0500 Subject: [PATCH] Big emojis: fix nodeList count --- app/soapbox/utils/rich_content.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/utils/rich_content.js b/app/soapbox/utils/rich_content.js index fc36733a5..dae13fb0c 100644 --- a/app/soapbox/utils/rich_content.js +++ b/app/soapbox/utils/rich_content.js @@ -2,10 +2,10 @@ export const onlyEmoji = (node, limit = 1) => { if (!node) return false; if (node.textContent.replaceAll(' ', '') !== '') return false; - const emojis = [...node.querySelectorAll('img.emojione')]; + const emojis = Array.from(node.querySelectorAll('img.emojione')); if (emojis.length === 0) return false; if (emojis.length > limit) return false; - const images = [...node.querySelectorAll('img')]; + const images = Array.from(node.querySelectorAll('img')); if (images.length > emojis.length) return false; return true; };