Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:iphone: loading

Vanessa86ecfb11af12
diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts
index c8988a550e..bb26b99e9b 100644
--- a/app/src/dialog/processSystem.ts
+++ b/app/src/dialog/processSystem.ts
@@ -338,7 +338,35 @@ export const downloadProgress = (data: { id: string, percent: number }) => {
};
export const processSync = (data?: IWebSocketData) => {
- const iconElement = document.querySelector(isMobile() ? "#menuSyncNow" : "#barSync");
+ /// #if MOBILE
+ const menuSyncUseElement = document.querySelector("#menuSyncNow use");
+ const barSyncUseElement = document.querySelector("#toolbarSync use");
+ if (!data) {
+ if (!window.siyuan.config.sync.enabled || (0 === window.siyuan.config.sync.provider && needSubscribe(""))) {
+ menuSyncUseElement?.setAttribute("xlink:href", "#iconCloudOff");
+ barSyncUseElement.setAttribute("xlink:href", "#iconCloudOff");
+ } else {
+ menuSyncUseElement?.setAttribute("xlink:href", "#iconCloudSucc");
+ barSyncUseElement.setAttribute("xlink:href", "#iconCloudSucc");
+ }
+ return;
+ }
+ menuSyncUseElement?.parentElement.classList.remove("fn__rotate");
+ barSyncUseElement.parentElement.classList.remove("fn__rotate");
+ if (data.code === 0) { // syncing
+ menuSyncUseElement?.parentElement.classList.add("fn__rotate");
+ barSyncUseElement.parentElement.classList.add("fn__rotate");
+ menuSyncUseElement?.setAttribute("xlink:href", "#iconRefresh");
+ barSyncUseElement.setAttribute("xlink:href", "#iconRefresh");
+ } else if (data.code === 2) { // error
+ menuSyncUseElement?.setAttribute("xlink:href", "#iconCloudError");
+ barSyncUseElement.setAttribute("xlink:href", "#iconCloudError");
+ } else if (data.code === 1) { // success
+ menuSyncUseElement?.setAttribute("xlink:href", "#iconCloudSucc");
+ barSyncUseElement.setAttribute("xlink:href", "#iconCloudSucc");
+ }
+ /// #else
+ const iconElement = document.querySelector("#barSync");
if (!iconElement) {
return;
}
@@ -366,4 +394,5 @@ export const processSync = (data?: IWebSocketData) => {
useElement.setAttribute("xlink:href", "#iconCloudSucc");
}
iconElement.setAttribute("aria-label", data.msg);
+ /// #endif
};