misc: remove unnecessary operation

This commit is contained in:
KOWX712
2025-04-02 13:23:01 +08:00
parent 487b2ed434
commit 63c10043dd
4 changed files with 7 additions and 12 deletions

View File

@@ -1,8 +1,5 @@
import { linkRedirect } from './main.js'; import { linkRedirect } from './main.js';
const telegramLink = document.getElementById('telegram');
const githubLink = document.getElementById('github');
// Function to show about overlay // Function to show about overlay
document.getElementById("about").addEventListener("click", () => { document.getElementById("about").addEventListener("click", () => {
const aboutOverlay = document.getElementById('about-overlay'); const aboutOverlay = document.getElementById('about-overlay');
@@ -33,9 +30,9 @@ document.getElementById("about").addEventListener("click", () => {
}); });
// Event listener for link redirect // Event listener for link redirect
telegramLink.addEventListener('click', function() { document.getElementById('telegram').addEventListener('click', function() {
linkRedirect('https://t.me/kowchannel'); linkRedirect('https://t.me/kowchannel');
}); });
githubLink.addEventListener('click', function() { document.getElementById('github').addEventListener('click', function() {
linkRedirect('https://github.com/KOWX712/Tricky-Addon-Update-Target-List'); linkRedirect('https://github.com/KOWX712/Tricky-Addon-Update-Target-List');
}); });

View File

@@ -10,7 +10,7 @@ let availableLanguages = ['en-US'];
* Detect user's default language * Detect user's default language
* @returns {Promise<string>} - Detected language code * @returns {Promise<string>} - Detected language code
*/ */
export async function detectUserLanguage() { async function detectUserLanguage() {
const userLang = navigator.language || navigator.userLanguage; const userLang = navigator.language || navigator.userLanguage;
const langCode = userLang.split('-')[0]; const langCode = userLang.split('-')[0];

View File

@@ -1,6 +1,6 @@
import { appListContainer, fetchAppList } from './applist.js'; import { appListContainer, fetchAppList } from './applist.js';
import { loadTranslations, setupLanguageMenu, translations } from './language.js'; import { loadTranslations, setupLanguageMenu, translations } from './language.js';
import { aospkb, setupSystemAppMenu } from './menu_option.js'; import { setupSystemAppMenu } from './menu_option.js';
import { searchMenuContainer, searchInput, clearBtn, setupMenuToggle } from './search_menu.js'; import { searchMenuContainer, searchInput, clearBtn, setupMenuToggle } from './search_menu.js';
import { updateCheck } from './update.js'; import { updateCheck } from './update.js';
import { securityPatch } from './security_patch.js'; import { securityPatch } from './security_patch.js';
@@ -44,7 +44,6 @@ async function getModuleVersion() {
moduleVersion.textContent = version; moduleVersion.textContent = version;
} catch (error) { } catch (error) {
console.error("Failed to read version from module.prop:", error); console.error("Failed to read version from module.prop:", error);
updateVersion("Error");
} }
} }
@@ -343,7 +342,6 @@ document.addEventListener('DOMContentLoaded', async () => {
floatingBtn.style.display = 'block'; floatingBtn.style.display = 'block';
hideFloatingBtn(false); hideFloatingBtn(false);
document.getElementById("refresh").addEventListener("click", refreshAppList); document.getElementById("refresh").addEventListener("click", refreshAppList);
document.getElementById("aospkb").addEventListener("click", aospkb);
document.querySelector('.uninstall-container').classList.remove('hidden-uninstall'); document.querySelector('.uninstall-container').classList.remove('hidden-uninstall');
}); });

View File

@@ -136,7 +136,7 @@ export async function setupSystemAppMenu() {
currentSystemAppListContent.innerHTML = ""; currentSystemAppListContent.innerHTML = "";
try { try {
const systemAppList = await execCommand(`[ -f "/data/adb/tricky_store/system_app" ] && cat "/data/adb/tricky_store/system_app" | sed '/^$/d' || echo "false"`); const systemAppList = await execCommand(`[ -f "/data/adb/tricky_store/system_app" ] && cat "/data/adb/tricky_store/system_app" | sed '/^$/d' || echo "false"`);
if (systemAppList.includes("false")) { if (systemAppList.trim() === 'false' || systemAppList.trim() === '') {
currentSystemAppList.style.display = "none"; currentSystemAppList.style.display = "none";
} else { } else {
systemAppList.split("\n").forEach(app => { systemAppList.split("\n").forEach(app => {
@@ -191,7 +191,7 @@ async function setKeybox(content) {
} }
// Function to replace aosp kb // Function to replace aosp kb
export async function aospkb() { document.getElementById("aospkb").addEventListener("click", async () => {
const source = await execCommand(`xxd -r -p ${basePath}/common/.default | base64 -d`); const source = await execCommand(`xxd -r -p ${basePath}/common/.default | base64 -d`);
const result = await setKeybox(source); const result = await setKeybox(source);
if (result) { if (result) {
@@ -200,7 +200,7 @@ export async function aospkb() {
} else { } else {
showPrompt("prompt.key_set_error", false); showPrompt("prompt.key_set_error", false);
} }
} });
// Function to replace valid kb // Function to replace valid kb
document.getElementById("validkb").addEventListener("click", async () => { document.getElementById("validkb").addEventListener("click", async () => {