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); setDefRefCount(data.data);
break; break;
case "reloadTag": case "reloadTag":
(getDockByType("tag")?.data.tag as Tag).update(); if (getDockByType("tag")?.data.tag instanceof Tag) {
(getDockByType("tag").data.tag as Tag).update();
}
break; break;
/// #if BROWSER /// #if BROWSER
case "setLocalShorthandCount": case "setLocalShorthandCount":

View File

@ -580,19 +580,17 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
enableProtyle(protyle); 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 MOBILE
if (window.siyuan.mobile.editor.protyle.background.ial.icon !== data.new.icon) { protyle = window.siyuan.mobile.editor.protyle;
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.background.ial.icon = data.new.icon;
protyle.background.render(protyle.background.ial, protyle.block.rootID);
protyle.model?.parent.setDocIcon(data.new.icon);
}
/// #endif /// #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);
} }
return; return;
} }