mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
a138fc821b
commit
76fd4c280a
2 changed files with 11 additions and 1 deletions
|
|
@ -499,6 +499,10 @@ export class MobileFiles extends Model {
|
||||||
} else {
|
} else {
|
||||||
targetElement.remove();
|
targetElement.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.siyuan.mobileEditor && window.siyuan.mobileEditor.protyle.path === data.data.path) {
|
||||||
|
setEmpty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import {fetchPost} from "./fetch";
|
||||||
import {getDisplayName, getOpenNotebookCount, pathPosix} from "./pathName";
|
import {getDisplayName, getOpenNotebookCount, pathPosix} from "./pathName";
|
||||||
import {openFileById} from "../editor/util";
|
import {openFileById} from "../editor/util";
|
||||||
import {Constants} from "../constants";
|
import {Constants} from "../constants";
|
||||||
|
import {isMobile} from "./functions";
|
||||||
|
import {openMobileFileById} from "../mobile/editor";
|
||||||
|
|
||||||
export const newFile = (notebookId?: string, currentPath?: string, open?: boolean) => {
|
export const newFile = (notebookId?: string, currentPath?: string, open?: boolean) => {
|
||||||
if (getOpenNotebookCount() === 0) {
|
if (getOpenNotebookCount() === 0) {
|
||||||
|
|
@ -57,8 +59,12 @@ export const newFile = (notebookId?: string, currentPath?: string, open?: boolea
|
||||||
md: "",
|
md: "",
|
||||||
}, () => {
|
}, () => {
|
||||||
if (open) {
|
if (open) {
|
||||||
|
if (isMobile()) {
|
||||||
|
openMobileFileById(id, true);
|
||||||
|
} else {
|
||||||
openFileById({id, hasContext: true, action: [Constants.CB_GET_HL]});
|
openFileById({id, hasContext: true, action: [Constants.CB_GET_HL]});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue