From 8bdedfa4f7583483994b559078489b4aca327e1e Mon Sep 17 00:00:00 2001 From: Mega-Volti <119437326+Mega-Volti@users.noreply.github.com> Date: Tue, 25 Jul 2023 18:28:34 +0200 Subject: [PATCH] Update resolvedicon.jsx - test for custom color suffix Changed if condition from string.match to string.test and expanded regex to also include upper case letters. --- src/components/resolvedicon.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/resolvedicon.jsx b/src/components/resolvedicon.jsx index f4314423..e0e56d92 100644 --- a/src/components/resolvedicon.jsx +++ b/src/components/resolvedicon.jsx @@ -38,7 +38,7 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log if (prefix in iconSetURLs) { // check whether icon ends with color code - if (!(suffix.match(`[#][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]`) == null)) { + if (suffix.test(`[#][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]`)) { const iconColor = `${suffix}`; const iconName = icon.replace(`${prefix}-`, "").replace(".svg", "").replace(`-${suffix}`, "");