diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts
index bd9f8bd81..ecb1f863a 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", '
');
+ protyle.element.removeAttribute("data-loading");
+ setTimeout(() => {
+ if (protyle.element.getAttribute("data-loading") !== "finished") {
+ protyle.element.insertAdjacentHTML("beforeend", '');
+ }
+ }, Constants.TIMEOUT_BLOCKLOAD);
};
export const removeLoading = (protyle: IProtyle) => {
+ protyle.element.setAttribute("data-loading", "finished");
const loadingElement = protyle.element.querySelector(".wysiwygLoading");
if (loadingElement) {
loadingElement.remove();