From 91ff8614cd02491b9150ee5d86c9f4e5f8ad7faf Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 7 May 2023 10:03:53 +0800 Subject: [PATCH] :art: Access to the OpenAI API is no longer supported on Huawei devices https://github.com/siyuan-note/siyuan/issues/8192 Fix https://github.com/siyuan-note/siyuan/issues/8192 --- app/src/mobile/menu/index.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/src/mobile/menu/index.ts b/app/src/mobile/menu/index.ts index f593dffcd..d65636676 100644 --- a/app/src/mobile/menu/index.ts +++ b/app/src/mobile/menu/index.ts @@ -35,6 +35,18 @@ export const initRightMenu = () => { ${window.siyuan.languages.login} `; } + + let aiHTML = ``; + const isHuawei = () => { + return 0 < window.siyuan.config.system.osPlatform.toLowerCase().indexOf("huawei") + } + if (isHuawei()) { + // Access to the OpenAI API is no longer supported on Huawei devices https://github.com/siyuan-note/siyuan/issues/8192 + aiHTML = ""; + } + menuElement.innerHTML = `
${window.siyuan.languages.back} @@ -76,9 +88,7 @@ export const initRightMenu = () => { - + ${aiHTML}