Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-10-04 10:14:56 +08:00
commit 1a821ee39b
7 changed files with 31 additions and 8 deletions

View file

@ -751,6 +751,7 @@ export class Files extends Model {
fetchPost("/api/filetree/listDocsByPath", {
notebook: toURL,
path: toDir === "/" ? "/" : toDir + ".sy",
app: Constants.SIYUAN_APPID,
}, response => {
if (response.data.path === "/" && response.data.files.length === 0) {
showMessage(window.siyuan.languages.emptyContent);
@ -1123,7 +1124,8 @@ data-type="navigation-root" data-path="/">
} else if (filePath.startsWith(item.path.replace(".sy", ""))) {
const response = await fetchSyncPost("/api/filetree/listDocsByPath", {
notebook: data.box,
path: item.path
path: item.path,
app: Constants.SIYUAN_APPID,
});
newLiElement = await this.selectItem(response.data.box, filePath, response.data, setStorage, isSetCurrent);
}
@ -1160,6 +1162,7 @@ data-type="navigation-root" data-path="/">
fetchPost("/api/filetree/listDocsByPath", {
notebook: notebookId,
path: liElement.getAttribute("data-path"),
app: Constants.SIYUAN_APPID,
}, response => {
if (response.data.path === "/" && response.data.files.length === 0) {
newFile({
@ -1215,7 +1218,8 @@ data-type="navigation-root" data-path="/">
} else {
const response = await fetchSyncPost("/api/filetree/listDocsByPath", {
notebook: notebookId,
path: currentPath
path: currentPath,
app: Constants.SIYUAN_APPID,
});
liElement = await this.onLsSelect(response.data, filePath, setStorage, isSetCurrent);
}

View file

@ -603,7 +603,8 @@ export class MobileFiles extends Model {
} else if (filePath.startsWith(item.path.replace(".sy", ""))) {
const response = await fetchSyncPost("/api/filetree/listDocsByPath", {
notebook: data.box,
path: item.path
path: item.path,
app: Constants.SIYUAN_APPID,
});
newLiElement = await this.selectItem(response.data.box, filePath, response.data, setStorage, isSetCurrent);
}
@ -640,6 +641,7 @@ export class MobileFiles extends Model {
fetchPost("/api/filetree/listDocsByPath", {
notebook: notebookId,
path: liElement.getAttribute("data-path"),
app: Constants.SIYUAN_APPID,
}, response => {
if (response.data.path === "/" && response.data.files.length === 0) {
newFile({
@ -695,7 +697,8 @@ export class MobileFiles extends Model {
} else {
const response = await fetchSyncPost("/api/filetree/listDocsByPath", {
notebook: notebookId,
path: currentPath
path: currentPath,
app: Constants.SIYUAN_APPID,
});
liElement = await this.onLsSelect(response.data, filePath, setStorage, isSetCurrent);
}

View file

@ -607,6 +607,7 @@ const getLeaf = (liElement: HTMLElement, flashcard: boolean) => {
notebook: notebookId,
path: liElement.getAttribute("data-path"),
flashcard,
app: Constants.SIYUAN_APPID,
}, response => {
if (response.data.files.length === 0) {
showMessage(window.siyuan.languages.emptyContent);