Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/6281

Vanessabfa3e66b162e
diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts
index 7487bb80ed..955a4f4e24 100644
--- a/app/src/util/assets.ts
+++ b/app/src/util/assets.ts
@@ -72,9 +72,12 @@ export const loadAssets = (data: IAppearance) => {
const iconURL = `/appearance/icons/${["ant", "material"].includes(data.icon) ? data.icon : "material"}/icon.js?v=${Constants.SIYUAN_VERSION}`;
if (iconDefaultScriptElement) {
iconDefaultScriptElement.remove();
- while (document.body.firstElementChild.tagName === "svg") {
- if (document.body.firstElementChild.id !== "emojiScriptSvg") {
- document.body.firstElementChild.remove();
+ let svgElement = document.body.firstElementChild
+ while (svgElement.tagName === "svg") {
+ const currentSvgElement = svgElement;
+ svgElement = svgElement.nextElementSibling;
+ if (currentSvgElement.id !== "emojiScriptSvg") {
+ currentSvgElement.remove();
}
}
loadThirdIcon(iconURL, data);