mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 14:56:09 +01:00
This commit is contained in:
parent
3dcbaf4c37
commit
775f9b39ab
5 changed files with 33 additions and 10 deletions
|
|
@ -22,6 +22,7 @@ import {hideAllElements, hideElements} from "../protyle/ui/hideElements";
|
|||
import {App} from "../index";
|
||||
import {saveScroll} from "../protyle/scroll/saveScroll";
|
||||
import {isInAndroid, isInIOS} from "../protyle/util/compatibility";
|
||||
import {Plugin} from "../plugin";
|
||||
|
||||
const updateTitle = (rootID: string, tab: Tab) => {
|
||||
fetchPost("/api/block/getDocInfo", {
|
||||
|
|
@ -411,7 +412,7 @@ export const downloadProgress = (data: { id: string, percent: number }) => {
|
|||
}
|
||||
};
|
||||
|
||||
export const processSync = (data?: IWebSocketData) => {
|
||||
export const processSync = (data?: IWebSocketData, plugins?: Plugin[]) => {
|
||||
/// #if MOBILE
|
||||
const menuSyncUseElement = document.querySelector("#menuSyncNow use");
|
||||
const barSyncUseElement = document.querySelector("#toolbarSync use");
|
||||
|
|
@ -467,4 +468,13 @@ export const processSync = (data?: IWebSocketData) => {
|
|||
useElement.setAttribute("xlink:href", "#iconCloudSucc");
|
||||
}
|
||||
/// #endif
|
||||
plugins.forEach((item) => {
|
||||
if (data.code === 0) {
|
||||
item.eventBus.emit("sync-start", data);
|
||||
} else if (data.code === 1) {
|
||||
item.eventBus.emit("sync-end", data);
|
||||
} else if (data.code === 2) {
|
||||
item.eventBus.emit("sync-fail", data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue