mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 19:01:47 +00:00
fix: fix unloader
This commit is contained in:
@ -21,6 +21,8 @@ const createContext = (id: string): PreloadContext<PluginConfig> => ({
|
||||
});
|
||||
|
||||
export const forceUnloadPreloadPlugin = (id: string) => {
|
||||
if (!loadedPluginMap[id]) return;
|
||||
|
||||
const hasStopped = stopPlugin(id, loadedPluginMap[id], {
|
||||
ctx: 'preload',
|
||||
context: createContext(id),
|
||||
@ -73,7 +75,7 @@ export const loadAllPreloadPlugins = () => {
|
||||
const pluginConfigs = config.plugins.getPlugins();
|
||||
|
||||
for (const [pluginId, pluginDef] of Object.entries(preloadPlugins)) {
|
||||
const config = deepmerge(pluginDef.config, pluginConfigs[pluginId] ?? {}) ;
|
||||
const config = deepmerge(pluginDef.config ?? { enable: false }, pluginConfigs[pluginId] ?? {}) ;
|
||||
|
||||
if (config.enabled) {
|
||||
forceLoadPreloadPlugin(pluginId);
|
||||
|
||||
Reference in New Issue
Block a user