From b3bd02c5a11ad1e7c4b50b642dacde39b7296751 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 7 Jul 2025 19:58:45 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/pull/15123 --- app/src/util/assets.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts index 8ee42ffb4..b2b3d292b 100644 --- a/app/src/util/assets.ts +++ b/app/src/util/assets.ts @@ -98,23 +98,31 @@ export const loadAssets = (data: Config.IAppearance) => { (!isBuiltInIcon && iconScriptElement && iconScriptElement.getAttribute("src").startsWith(iconThirdURL))) { return; } - Array.from(document.body.children).forEach(item => { - if (item.tagName === "svg" && !item.getAttribute("data-name") && item.id !== "iconsMaterial") { - item.remove(); - } - }); if (iconDefaultScriptElement && !iconDefaultScriptElement.getAttribute("src").startsWith(iconDefaultURL)) { iconDefaultScriptElement.remove(); if (data.icon === "ant") { document.querySelectorAll("#iconsMaterial").forEach(item => { item.remove(); }); + } else { + document.querySelectorAll("#iconsAnt").forEach(item => { + item.remove(); + }); } } addScript(iconDefaultURL, "iconDefaultScript").then(() => { if (!isBuiltInIcon) { iconScriptElement?.remove(); - addScript(iconThirdURL, "iconScript"); + addScript(iconThirdURL, "iconScript").then(() => { + Array.from(document.body.children).forEach((item, index) => { + if (item.tagName === "svg" && + index !== 0 && + !item.getAttribute("data-name") && + !["iconsMaterial", "iconsAnt"].includes(item.id)) { + item.remove(); + } + }); + }); } }); };