📱 标题为空的处理

This commit is contained in:
Vanessa 2022-06-18 23:02:21 +08:00
parent da19c1fc47
commit 975fd55963
2 changed files with 2 additions and 1 deletions

View file

@ -85,7 +85,7 @@ export const openMobileFileById = (id: string, hasContext?: boolean, action = [C
}
});
}
(document.getElementById("toolbarName") as HTMLInputElement).value = data.data.rootTitle;
(document.getElementById("toolbarName") as HTMLInputElement).value = data.data.rootTitle === "Untitled" ? "" : data.data.rootTitle;
setEditor();
closePanel();
if (pushStack) {

View file

@ -115,6 +115,7 @@ export const initFramework = () => {
const initEditorName = () => {
const inputElement = document.getElementById("toolbarName") as HTMLInputElement;
inputElement.setAttribute("placeholder", window.siyuan.languages._kernel[16]);
inputElement.addEventListener("blur", () => {
if (window.siyuan.config.readonly || document.querySelector("#toolbarEdit use").getAttribute("xlink:href") === "#iconEdit") {
return;