feat: icon 支持base64格式

pull/3111/head
wswang9 3 months ago
parent 247f73f0db
commit e29d5b2647

@ -13,8 +13,9 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
const { settings } = useContext(SettingsContext); const { settings } = useContext(SettingsContext);
const { theme } = useContext(ThemeContext); const { theme } = useContext(ThemeContext);
// direct or relative URLs // direct or relative URLs or base64
if (icon.startsWith("http") || icon.startsWith("/")) { const base64Reg = /data:image\/.*;base64,/;
if (icon.startsWith("http") || icon.startsWith("/") || base64Reg.test(icon)) {
return ( return (
<Image <Image
src={`${icon}`} src={`${icon}`}

Loading…
Cancel
Save