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/8216

Vanessa18071638cfff
diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts
index de73f34d4e..a76f829936 100644
--- a/app/src/protyle/breadcrumb/index.ts
+++ b/app/src/protyle/breadcrumb/index.ts
@@ -243,16 +243,6 @@ export class Breadcrumb {
hideElements(["toolbar"], protyle);
fetchPost("/api/format/autoSpace", {
id: protyle.block.rootID
- }, () => {
- /// #if MOBILE
- reloadProtyle(protyle, false);
- /// #else
- getAllModels().editor.forEach(item => {
- if (item.editor.protyle.block.rootID === protyle.block.rootID) {
- reloadProtyle(item.editor.protyle, item.editor.protyle.element.isSameNode(protyle.element));
- }
- });
- /// #endif
});
}
}).element);
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts
index 8563299f2c..752f6011ed 100644
--- a/app/src/protyle/index.ts
+++ b/app/src/protyle/index.ts
@@ -96,7 +96,7 @@ export class Protyle {
break;
case "addLoadding":
if (data.data === this.protyle.block.rootID) {
- addLoading(this.protyle);
+ addLoading(this.protyle, data.msg);
}
break;
case "transactions":
diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts
index c7c8481f82..0dacc8804a 100644
--- a/app/src/protyle/ui/initUI.ts
+++ b/app/src/protyle/ui/initUI.ts
@@ -102,21 +102,23 @@ export const initUI = (protyle: IProtyle) => {
}, {passive: false});
};
-export const addLoading = (protyle: IProtyle) => {
+export const addLoading = (protyle: IProtyle, msg?: string) => {
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>');
+ protyle.element.insertAdjacentHTML("beforeend", `<div style="background-color: var(--b3-theme-background);flex-direction: column;" class="fn__loading wysiwygLoading">
+ <img width="48px" src="/stage/loading-pure.svg">
+ <div style="color: var(--b3-theme-on-surface);margin-top: 8px;">${msg || ""}</div>
+</div>`);
}
}, Constants.TIMEOUT_LOAD);
};
export const removeLoading = (protyle: IProtyle) => {
protyle.element.setAttribute("data-loading", "finished");
- const loadingElement = protyle.element.querySelector(".wysiwygLoading");
- if (loadingElement) {
- loadingElement.remove();
- }
+ protyle.element.querySelectorAll(".wysiwygLoading").forEach(item => {
+ item.remove();
+ });
};
export const setPadding = (protyle: IProtyle) => {