From e29d5b2647adcd98bc473aadb9bc23787279cce1 Mon Sep 17 00:00:00 2001 From: wswang9 Date: Wed, 13 Mar 2024 16:22:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20icon=20=E6=94=AF=E6=8C=81base64?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/resolvedicon.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/resolvedicon.jsx b/src/components/resolvedicon.jsx index 885bbfac..0e1d513e 100644 --- a/src/components/resolvedicon.jsx +++ b/src/components/resolvedicon.jsx @@ -13,8 +13,9 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log const { settings } = useContext(SettingsContext); const { theme } = useContext(ThemeContext); - // direct or relative URLs - if (icon.startsWith("http") || icon.startsWith("/")) { + // direct or relative URLs or base64 + const base64Reg = /data:image\/.*;base64,/; + if (icon.startsWith("http") || icon.startsWith("/") || base64Reg.test(icon)) { return (