This commit is contained in:
Vanessa 2023-10-30 00:22:37 +08:00
parent fbe0f4f303
commit c437f8df9e
2 changed files with 9 additions and 20 deletions

View file

@ -51,26 +51,10 @@ export const setEmpty = (app: App) => {
event.preventDefault();
break;
} else if (target.id === "emptyNewFile") {
if (window.siyuan.mobile.editor) {
newFile({
app,
notebookId: window.siyuan.mobile.editor.protyle.notebookId,
currentPath: window.siyuan.mobile.editor.protyle.path,
useSavePath: true
});
} else {
window.siyuan.notebooks.find(item => {
if (!item.closed) {
newFile({
app,
notebookId: item.id,
currentPath: "/",
useSavePath: true
});
return true;
}
});
}
newFile({
app,
useSavePath: true
});
event.stopPropagation();
event.preventDefault();
break;