This commit is contained in:
parent
8824e552da
commit
70d0246668
1 changed files with 9 additions and 4 deletions
|
@ -1200,7 +1200,7 @@ const renderNextSearchMark = (options: {
|
|||
}
|
||||
};
|
||||
|
||||
let reqId: number
|
||||
let articleId: string
|
||||
|
||||
export const getArticle = (options: {
|
||||
id: string,
|
||||
|
@ -1208,14 +1208,20 @@ export const getArticle = (options: {
|
|||
edit: Protyle
|
||||
value?: string,
|
||||
}) => {
|
||||
articleId = options.id
|
||||
checkFold(options.id, (zoomIn) => {
|
||||
if (articleId !== options.id) {
|
||||
return;
|
||||
}
|
||||
options.edit.protyle.scroll.lastScrollTop = 0;
|
||||
addLoading(options.edit.protyle);
|
||||
fetchPost("/api/block/getDocInfo", {
|
||||
id: options.id,
|
||||
}, (response) => {
|
||||
if (articleId !== options.id) {
|
||||
return;
|
||||
}
|
||||
options.edit.protyle.wysiwyg.renderCustom(response.data.ial);
|
||||
reqId = new Date().getTime()
|
||||
fetchPost("/api/filetree/getDoc", {
|
||||
id: options.id,
|
||||
query: options.value || null,
|
||||
|
@ -1225,9 +1231,8 @@ export const getArticle = (options: {
|
|||
size: zoomIn ? Constants.SIZE_GET_MAX : window.siyuan.config.editor.dynamicLoadBlocks,
|
||||
zoom: zoomIn,
|
||||
highlight: !isSupportCSSHL(),
|
||||
reqId
|
||||
}, getResponse => {
|
||||
if (reqId > response.data.reqId) {
|
||||
if (articleId !== options.id) {
|
||||
return;
|
||||
}
|
||||
options.edit.protyle.query = {
|
||||
|
|
Loading…
Add table
Reference in a new issue