From ed52f332da8a189eb1141e1f2c17f50c50562d1a Mon Sep 17 00:00:00 2001 From: pylixonly <82711525+pylixonly@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:10:33 +0800 Subject: [PATCH] fix: load core plugins --- src/index.ts | 5 +++-- src/lib/plugins/index.ts | 9 +-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2d45280..8ccc390 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,7 +10,7 @@ import { removeFile, writeFile } from "@lib/api/native/fs"; import { isPyonLoader, isThemeSupported } from "@lib/api/native/loader"; import { FileManager } from "@lib/api/native/modules"; import { updateFonts } from "@lib/fonts"; -import { initPlugins } from "@lib/plugins"; +import { initPlugins, registerCorePlugins } from "@lib/plugins"; import { initThemes, patchChatBackground } from "@lib/themes"; import { logger } from "@lib/utils/logger"; import initSafeMode from "@ui/safeMode"; @@ -46,7 +46,8 @@ export default async () => { initFetchI18nStrings(), initSettings(), initFixes(), - initSafeMode() + initSafeMode(), + registerCorePlugins() ]).then( // Push them all to unloader u => u.forEach(f => f && lib.unload.push(f)) diff --git a/src/lib/plugins/index.ts b/src/lib/plugins/index.ts index f3de7a1..2489253 100644 --- a/src/lib/plugins/index.ts +++ b/src/lib/plugins/index.ts @@ -347,7 +347,7 @@ export function stopPlugin(id: string) { pluginInstances.delete(id); } -export async function checkAndRegisterUpdates() { +export async function registerCorePlugins() { await awaitStorage(pluginRepositories, pluginSettings); const corePlugins = getCorePlugins(); @@ -366,13 +366,6 @@ export async function checkAndRegisterUpdates() { manifestToId.set(instance.manifest, id); corePluginInstances.set(id, instance); } - - // await updateRepository(OFFICIAL_PLUGINS_REPO_URL); - // await Promise.allSettled(Object.keys(pluginRepositories).map(async repo => { - // if (repo !== OFFICIAL_PLUGINS_REPO_URL) { - // await updateRepository(repo); - // } - // })); } /**