Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/8158

Vanessaed30175daf03
diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts
index bd9f8bd814..ecb1f863ab 100644
--- a/app/src/protyle/ui/initUI.ts
+++ b/app/src/protyle/ui/initUI.ts
@@ -73,10 +73,16 @@ export const initUI = (protyle: IProtyle) => {
};
export const addLoading = (protyle: IProtyle) => {
- protyle.element.insertAdjacentHTML("beforeend", '<div style="background-color: var(--b3-theme-background)" class="fn__loading wysiwygLoading"><img width="48px" src="/stage/loading-pure.svg"></div>');
+ protyle.element.removeAttribute("data-loading");
+ setTimeout(() => {
+ if (protyle.element.getAttribute("data-loading") !== "finished") {
+ protyle.element.insertAdjacentHTML("beforeend", '<div style="background-color: var(--b3-theme-background)" class="fn__loading wysiwygLoading"><img width="48px" src="/stage/loading-pure.svg"></div>');
+ }
+ }, Constants.TIMEOUT_BLOCKLOAD);
};
export const removeLoading = (protyle: IProtyle) => {
+ protyle.element.setAttribute("data-loading", "finished");
const loadingElement = protyle.element.querySelector(".wysiwygLoading");
if (loadingElement) {
loadingElement.remove();