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

Vanessaa138fc821be1
diff --git a/app/src/emoji/index.ts b/app/src/emoji/index.ts
index d18ae98942..ea5dc6e8fb 100644
--- a/app/src/emoji/index.ts
+++ b/app/src/emoji/index.ts
@@ -392,6 +392,9 @@ ${unicode2Emoji(emoji.unicode)}</button>`;
};
export const updateOutlineEmoji = (unicode: string) => {
+ if (isMobile()) {
+ return;
+ }
getAllModels().outline.forEach(model => {
model.headerElement.nextElementSibling.firstElementChild.innerHTML = unicode2Emoji(unicode || Constants.SIYUAN_IMAGE_FILE);
});
@@ -400,11 +403,7 @@ export const updateOutlineEmoji = (unicode: string) => {
export const updateFileTreeEmoji = (unicode: string, id: string, icon = "iconFile") => {
let emojiElement;
if (isMobile()) {
- if (icon === "iconFile") {
- emojiElement = document.querySelector(`#fileTree [data-node-id="${id}"] .b3-list-item__icon`);
- } else {
- emojiElement = document.querySelector(`#fileTree [data-node-id="${id}"] .b3-list-item__icon`) || document.querySelector(`#fileTree [data-url="${id}"] .b3-list-item__icon`);
- }
+ emojiElement = document.querySelector(`#sidebar [data-type="sidebar-file"] [data-node-id="${id}"] .b3-list-item__icon`);
} else {
const files = getDockByType("file").data.file as Files;
if (icon === "iconFile") {
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index 356bcc62d4..c187c647be 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -194,7 +194,7 @@ export class Files extends Model {
event.preventDefault();
event.stopPropagation();
if (target.parentElement.getAttribute("data-type") === "navigation-file") {
- openEmojiPanel(target.parentElement.getAttribute("data-node-id"), target, false);
+ openEmojiPanel(target.parentElement.getAttribute("data-node-id"), target);
} else {
openEmojiPanel(target.parentElement.parentElement.getAttribute("data-url"), target, true);
}
diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts
index f4e401a05c..d8247ce1ed 100644
--- a/app/src/protyle/header/Background.ts
+++ b/app/src/protyle/header/Background.ts
@@ -235,7 +235,9 @@ export class Background {
id: protyle.block.rootID,
attrs: {"icon": emoji}
});
- protyle.model.parent.setDocIcon(emoji);
+ if (protyle.model) {
+ protyle.model.parent.setDocIcon(emoji);
+ }
}
event.preventDefault();
event.stopPropagation();