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/6668

Vanessaf23cd5005de3
diff --git a/app/src/emoji/index.ts b/app/src/emoji/index.ts
index 5c5702603f..fc64a527f2 100644
--- a/app/src/emoji/index.ts
+++ b/app/src/emoji/index.ts
@@ -267,7 +267,7 @@ export const openEmojiPanel = (id: string, target: HTMLElement, isNotebook = fal
addEmoji(unicode);
updateFileTreeEmoji(unicode, id);
updateFileEmoji(unicode, id);
- updateOutlineEmoji(unicode);
+ updateOutlineEmoji(unicode, id);
});
}
event.preventDefault();
@@ -357,7 +357,7 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
window.siyuan.menus.menu.remove();
updateFileTreeEmoji("", id);
updateFileEmoji("", id);
- updateOutlineEmoji("");
+ updateOutlineEmoji("", id);
});
}
return;
@@ -387,7 +387,7 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
addEmoji(unicode);
updateFileTreeEmoji(unicode, id);
updateFileEmoji(unicode, id);
- updateOutlineEmoji(unicode);
+ updateOutlineEmoji(unicode, id);
});
}
return;
@@ -395,10 +395,12 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
});
};
-export const updateOutlineEmoji = (unicode: string) => {
+export const updateOutlineEmoji = (unicode: string, id:string) => {
/// #if !MOBILE
getAllModels().outline.forEach(model => {
- model.headerElement.nextElementSibling.firstElementChild.innerHTML = unicode2Emoji(unicode || Constants.SIYUAN_IMAGE_FILE);
+ if (model.blockId === id) {
+ model.headerElement.nextElementSibling.firstElementChild.innerHTML = unicode2Emoji(unicode || Constants.SIYUAN_IMAGE_FILE);
+ }
});
/// #endif
};
diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts
index 3cd736f0de..ba2a25b5be 100644
--- a/app/src/protyle/header/Background.ts
+++ b/app/src/protyle/header/Background.ts
@@ -262,7 +262,7 @@ export class Background {
this.ial.icon = emoji;
this.render(this.ial, protyle.block.rootID);
updateFileTreeEmoji(emoji, protyle.block.rootID);
- updateOutlineEmoji(emoji);
+ updateOutlineEmoji(emoji, protyle.block.rootID);
fetchPost("/api/attr/setBlockAttrs", {
id: protyle.block.rootID,
attrs: {"icon": emoji}