mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🎨 getBlockInfo 返回 code = 3 时告知用户正在索引,请稍后再试
This commit is contained in:
parent
35f7fd0b66
commit
e782e034cc
4 changed files with 19 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ import {getPreviousHeading} from "../protyle/wysiwyg/getBlock";
|
||||||
import {lockFile, setTitle} from "../dialog/processSystem";
|
import {lockFile, setTitle} from "../dialog/processSystem";
|
||||||
import {zoomOut} from "../menus/protyle";
|
import {zoomOut} from "../menus/protyle";
|
||||||
import {countBlockWord, countSelectWord} from "../layout/status";
|
import {countBlockWord, countSelectWord} from "../layout/status";
|
||||||
|
import {showMessage} from "../dialog/message";
|
||||||
|
|
||||||
export const openFileById = (options: {
|
export const openFileById = (options: {
|
||||||
id: string,
|
id: string,
|
||||||
|
|
@ -39,6 +40,10 @@ export const openFileById = (options: {
|
||||||
lockFile(data.data);
|
lockFile(data.data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (data.code === 3) {
|
||||||
|
showMessage(data.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (typeof options.removeCurrentTab === "undefined") {
|
if (typeof options.removeCurrentTab === "undefined") {
|
||||||
options.removeCurrentTab = true;
|
options.removeCurrentTab = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import {setEditMode} from "../protyle/util/setEditMode";
|
||||||
import {hideElements} from "../protyle/ui/hideElements";
|
import {hideElements} from "../protyle/ui/hideElements";
|
||||||
import {pushBack} from "./util/MobileBackFoward";
|
import {pushBack} from "./util/MobileBackFoward";
|
||||||
import {setStorageVal} from "../protyle/util/compatibility";
|
import {setStorageVal} from "../protyle/util/compatibility";
|
||||||
|
import {showMessage} from "../dialog/message";
|
||||||
|
|
||||||
export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) => {
|
export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) => {
|
||||||
window.siyuan.storage[Constants.LOCAL_DOCINFO] = {id, action};
|
window.siyuan.storage[Constants.LOCAL_DOCINFO] = {id, action};
|
||||||
|
|
@ -44,6 +45,10 @@ export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) =
|
||||||
lockFile(data.data);
|
lockFile(data.data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (data.code === 3) {
|
||||||
|
showMessage(data.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (window.siyuan.mobile.editor) {
|
if (window.siyuan.mobile.editor) {
|
||||||
pushBack();
|
pushBack();
|
||||||
addLoading(window.siyuan.mobile.editor.protyle);
|
addLoading(window.siyuan.mobile.editor.protyle);
|
||||||
|
|
|
||||||
|
|
@ -484,7 +484,10 @@ const getExportPath = (option: { type: string, id: string }, removeAssets?: bool
|
||||||
lockFile(response.data);
|
lockFile(response.data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (response.code === 3) {
|
||||||
|
showMessage(response.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
let exportType = "HTML (SiYuan)";
|
let exportType = "HTML (SiYuan)";
|
||||||
switch (option.type) {
|
switch (option.type) {
|
||||||
case "htmlmd":
|
case "htmlmd":
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {onGet} from "../protyle/util/onGet";
|
||||||
import {scrollCenter} from "./highlightById";
|
import {scrollCenter} from "./highlightById";
|
||||||
import {lockFile} from "../dialog/processSystem";
|
import {lockFile} from "../dialog/processSystem";
|
||||||
import {zoomOut} from "../menus/protyle";
|
import {zoomOut} from "../menus/protyle";
|
||||||
|
import {showMessage} from "../dialog/message";
|
||||||
|
|
||||||
let forwardStack: IBackStack[] = [];
|
let forwardStack: IBackStack[] = [];
|
||||||
let previousIsBack = false;
|
let previousIsBack = false;
|
||||||
|
|
@ -42,6 +43,10 @@ const focusStack = async (stack: IBackStack) => {
|
||||||
lockFile(info.data);
|
lockFile(info.data);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (info.code === 3) {
|
||||||
|
showMessage(info.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const tab = new Tab({
|
const tab = new Tab({
|
||||||
title: info.data.rootTitle,
|
title: info.data.rootTitle,
|
||||||
docIcon: info.data.rootIcon,
|
docIcon: info.data.rootIcon,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue