mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 inbox
This commit is contained in:
parent
58e2bf4948
commit
9ddbb930e7
1 changed files with 20 additions and 21 deletions
|
|
@ -3,7 +3,7 @@ import {Tab} from "../Tab";
|
||||||
import {setPanelFocus} from "../util";
|
import {setPanelFocus} from "../util";
|
||||||
import {getDockByType} from "../tabUtil";
|
import {getDockByType} from "../tabUtil";
|
||||||
/// #endif
|
/// #endif
|
||||||
import {fetchPost} from "../../util/fetch";
|
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
||||||
import {updateHotkeyAfterTip} from "../../protyle/util/compatibility";
|
import {updateHotkeyAfterTip} from "../../protyle/util/compatibility";
|
||||||
import {Model} from "../Model";
|
import {Model} from "../Model";
|
||||||
import {needSubscribe} from "../../util/needSubscribe";
|
import {needSubscribe} from "../../util/needSubscribe";
|
||||||
|
|
@ -333,27 +333,26 @@ ${data.shorthandContent}
|
||||||
}
|
}
|
||||||
|
|
||||||
private move(ids: string[]) {
|
private move(ids: string[]) {
|
||||||
movePathTo((toPath, toNotebook) => {
|
movePathTo(async (toPath, toNotebook) => {
|
||||||
ids.forEach(item => {
|
for (let i = 0; i < ids.length; i++) {
|
||||||
fetchPost("/api/inbox/getShorthand", {
|
const idItem = ids[i];
|
||||||
id: item
|
const response = await fetchSyncPost("/api/inbox/getShorthand", {
|
||||||
}, (response) => {
|
id: idItem
|
||||||
this.data[response.data.oId] = response.data;
|
|
||||||
let md = response.data.shorthandMd;
|
|
||||||
if ("" === md && "" === response.data.shorthandContent && "" != response.data.shorthandURL) {
|
|
||||||
md = "[" + response.data.shorthandTitle + "](" + response.data.shorthandURL + ")";
|
|
||||||
}
|
|
||||||
fetchPost("/api/filetree/createDoc", {
|
|
||||||
notebook: toNotebook[0],
|
|
||||||
path: pathPosix().join(getDisplayName(toPath[0], false, true), Lute.NewNodeID() + ".sy"),
|
|
||||||
title: replaceFileName(response.data.shorthandTitle),
|
|
||||||
md: md,
|
|
||||||
listDocTree: true,
|
|
||||||
}, () => {
|
|
||||||
this.remove(item);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
this.data[response.data.oId] = response.data;
|
||||||
|
let md = response.data.shorthandMd;
|
||||||
|
if ("" === md && "" === response.data.shorthandContent && "" != response.data.shorthandURL) {
|
||||||
|
md = "[" + response.data.shorthandTitle + "](" + response.data.shorthandURL + ")";
|
||||||
|
}
|
||||||
|
await fetchSyncPost("/api/filetree/createDoc", {
|
||||||
|
notebook: toNotebook[0],
|
||||||
|
path: pathPosix().join(getDisplayName(toPath[0], false, true), Lute.NewNodeID() + ".sy"),
|
||||||
|
title: replaceFileName(response.data.shorthandTitle),
|
||||||
|
md: md,
|
||||||
|
listDocTree: true,
|
||||||
|
});
|
||||||
|
this.remove(idItem);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue