mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
2ac8151c7a
commit
0d6939fcdf
8 changed files with 69 additions and 18 deletions
|
|
@ -311,3 +311,19 @@ export const downloadProgress = (data: { id: string, percent: number }) => {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const processSync = (data: IWebSocketData) => {
|
||||
const iconElement = document.querySelector("#barSync")
|
||||
const useElement = iconElement.querySelector("use")
|
||||
if (data.code === 0) { // syncing
|
||||
iconElement.classList.add("toolbar__item--active");
|
||||
useElement.setAttribute("xlink:href", "#iconCloudSync")
|
||||
} else if (data.code === 2) { // error
|
||||
iconElement.classList.add("toolbar__item--active");
|
||||
useElement.setAttribute("xlink:href", "#iconCloudError")
|
||||
} else if (data.code === 1) { // success
|
||||
iconElement.classList.remove("toolbar__item--active");
|
||||
useElement.setAttribute("xlink:href", "#iconCloud")
|
||||
}
|
||||
iconElement.setAttribute("aria-label", data.msg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue