Vanessa 2023-05-14 10:34:48 +08:00
parent f8412a49c4
commit 3edd8230d3

View file

@ -2,7 +2,7 @@ import {Constants} from "../constants";
import {Hint} from "./hint"; import {Hint} from "./hint";
import {setLute} from "./markdown/setLute"; import {setLute} from "./markdown/setLute";
import {Preview} from "./preview"; import {Preview} from "./preview";
import {initUI, removeLoading, setPadding} from "./ui/initUI"; import {addLoading, initUI, removeLoading, setPadding} from "./ui/initUI";
import {Undo} from "./undo"; import {Undo} from "./undo";
import {Upload} from "./upload"; import {Upload} from "./upload";
import {Options} from "./util/Options"; import {Options} from "./util/Options";
@ -89,6 +89,16 @@ export class Protyle {
type: "protyle", type: "protyle",
msgCallback: (data) => { msgCallback: (data) => {
switch (data.cmd) { switch (data.cmd) {
case "reload":
if (data.data === this.protyle.block.rootID) {
reloadProtyle(this.protyle, false);
}
break;
case "addLoadding":
if (data.data === this.protyle.block.rootID) {
addLoading(this.protyle);
}
break;
case "transactions": case "transactions":
data.data[0].doOperations.forEach((item: IOperation) => { data.data[0].doOperations.forEach((item: IOperation) => {
onTransaction(this.protyle, item, false); onTransaction(this.protyle, item, false);