From e58a869e0e976ee47868bb1fb845370d630a3f64 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 4 Dec 2024 17:40:16 +0800 Subject: [PATCH] :art: Support HarmonyOS NEXT system --- app/src/protyle/util/addScript.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/util/addScript.ts b/app/src/protyle/util/addScript.ts index 3396c9d3c..f88263c21 100644 --- a/app/src/protyle/util/addScript.ts +++ b/app/src/protyle/util/addScript.ts @@ -1,4 +1,4 @@ -export const addScriptSync = (path: string, id: string) => { +export const addScriptSync = async (path: string, id: string) => { if (document.getElementById(id)) { return false; } @@ -12,6 +12,10 @@ export const addScriptSync = (path: string, id: string) => { scriptElement.text = xhrObj.responseText; scriptElement.id = id; document.head.appendChild(scriptElement); + if (typeof Lute === "undefined") { + // 鸿蒙系统上第一次加载会出现 Lute 未定义的情况,重新载入一次就好了,暂时没找到原因,先这样处理 + window.location.reload(); + } }; export const addScript = (path: string, id: string) => {