From a9eab165a0914897648309c2dad13ff3d95babdb Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Fri, 11 Apr 2025 00:42:22 +0800 Subject: [PATCH] fix: no internet prompt when no valid key is available --- module/webui/scripts/menu_option.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/module/webui/scripts/menu_option.js b/module/webui/scripts/menu_option.js index f7ec732..0645efa 100644 --- a/module/webui/scripts/menu_option.js +++ b/module/webui/scripts/menu_option.js @@ -195,8 +195,11 @@ async function setKeybox(content) { } } -// Function to replace aosp kb -document.getElementById("aospkb").addEventListener("click", async () => { +/** + * Set aosp key + * @returns {Promise} + */ +async function aospkb() { const source = await execCommand(`xxd -r -p ${basePath}/common/.default | base64 -d`); const result = await setKeybox(source); if (result) { @@ -205,9 +208,12 @@ document.getElementById("aospkb").addEventListener("click", async () => { } else { showPrompt("prompt.key_set_error", false); } -}); +} -// Function to replace valid kb +// aosp kb eventlistener +document.getElementById("aospkb").addEventListener("click", async () => aospkb()); + +// valid kb eventlistener document.getElementById("validkb").addEventListener("click", async () => { fetch("https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/main/.extra") .then(response => {