Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/pull/15123

Vanessae1050ba73b2b
diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts
index b2b3d292b0..624416fb15 100644
--- a/app/src/util/assets.ts
+++ b/app/src/util/assets.ts
@@ -96,6 +96,17 @@ export const loadAssets = (data: Config.IAppearance) => {
if ((isBuiltInIcon && iconDefaultScriptElement && iconDefaultScriptElement.getAttribute("src").startsWith(iconDefaultURL)) ||
(!isBuiltInIcon && iconScriptElement && iconScriptElement.getAttribute("src").startsWith(iconThirdURL))) {
+ // 第三方图标切换到 material
+ if (isBuiltInIcon) {
+ iconScriptElement?.remove();
+ Array.from(document.body.children).forEach((item) => {
+ if (item.tagName === "svg" &&
+ !item.getAttribute("data-name") &&
+ !["iconsMaterial", "iconsAnt"].includes(item.id)) {
+ item.remove();
+ }
+ });
+ }
return;
}
if (iconDefaultScriptElement && !iconDefaultScriptElement.getAttribute("src").startsWith(iconDefaultURL)) {
@@ -111,8 +122,8 @@ export const loadAssets = (data: Config.IAppearance) => {
}
}
addScript(iconDefaultURL, "iconDefaultScript").then(() => {
+ iconScriptElement?.remove();
if (!isBuiltInIcon) {
- iconScriptElement?.remove();
addScript(iconThirdURL, "iconScript").then(() => {
Array.from(document.body.children).forEach((item, index) => {
if (item.tagName === "svg" &&