mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-16 00:50:56 +08:00
This commit is contained in:
parent
fbe0f4f303
commit
c437f8df9e
@ -51,26 +51,10 @@ export const setEmpty = (app: App) => {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
} else if (target.id === "emptyNewFile") {
|
} else if (target.id === "emptyNewFile") {
|
||||||
if (window.siyuan.mobile.editor) {
|
newFile({
|
||||||
newFile({
|
app,
|
||||||
app,
|
useSavePath: true
|
||||||
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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
@ -53,6 +53,11 @@ export const getNewFilePath = (useSavePath: boolean) => {
|
|||||||
/// #else
|
/// #else
|
||||||
if (window.siyuan.mobile.editor) {
|
if (window.siyuan.mobile.editor) {
|
||||||
notebookId = window.siyuan.mobile.editor.protyle.notebookId;
|
notebookId = window.siyuan.mobile.editor.protyle.notebookId;
|
||||||
|
if (useSavePath) {
|
||||||
|
currentPath = window.siyuan.mobile.editor.protyle.path;
|
||||||
|
} else {
|
||||||
|
currentPath = pathPosix().dirname(window.siyuan.mobile.editor.protyle.path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// #endif
|
/// #endif
|
||||||
if (!notebookId) {
|
if (!notebookId) {
|
||||||
|
Loading…
Reference in New Issue
Block a user