Vanessa 2025-04-18 11:37:48 +08:00
parent a05faf6fc1
commit 5c739ffa77
2 changed files with 12 additions and 12 deletions

View File

@ -71,7 +71,9 @@ export class App {
setDefRefCount(data.data);
break;
case "reloadTag":
(getDockByType("tag")?.data.tag as Tag).update();
if (getDockByType("tag")?.data.tag instanceof Tag) {
(getDockByType("tag").data.tag as Tag).update();
}
break;
/// #if BROWSER
case "setLocalShorthandCount":

View File

@ -580,20 +580,18 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
enableProtyle(protyle);
}
}
if (data.new.icon !== data.old.icon) {
if (data.new.icon !== data.old.icon ||
data.new["title-img"] !== data.old["title-img"] ||
data.new.tags !== data.old.tags && protyle.background) {
/// #if MOBILE
if (window.siyuan.mobile.editor.protyle.background.ial.icon !== data.new.icon) {
window.siyuan.mobile.editor.protyle.background.ial.icon = data.new.icon;
window.siyuan.mobile.editor.protyle.background.render(window.siyuan.mobile.editor.protyle.background.ial, window.siyuan.mobile.editor.protyle.block.rootID);
}
/// #else
if (protyle.background && protyle.background.ial.icon !== data.new.icon) {
protyle = window.siyuan.mobile.editor.protyle;
/// #endif
protyle.background.ial.icon = data.new.icon;
protyle.background.ial.tags = data.new.tags;
protyle.background.ial["title-img"] = data.new["title-img"];
protyle.background.render(protyle.background.ial, protyle.block.rootID);
protyle.model?.parent.setDocIcon(data.new.icon);
}
/// #endif
}
return;
}
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach((item: HTMLElement) => {