mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 03:11:46 +00:00
feat: run prettier
This commit is contained in:
@ -69,10 +69,10 @@ export const forceUnloadMainPlugin = async (
|
||||
plugin.backend)
|
||||
) {
|
||||
delete loadedPluginMap[id];
|
||||
console.log(LoggerPrefix, t(
|
||||
'common.console.plugins.unloaded',
|
||||
{ pluginName: id },
|
||||
));
|
||||
console.log(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.unloaded', { pluginName: id }),
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
console.log(
|
||||
|
||||
@ -52,12 +52,14 @@ export const forceLoadMenuPlugin = async (id: string, win: BrowserWindow) => {
|
||||
|
||||
console.log(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.loaded', { pluginName: `${id}::menu` })
|
||||
t('common.console.plugins.loaded', { pluginName: `${id}::menu` }),
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.initialize-failed', { pluginName: `${id}::menu` }),
|
||||
t('common.console.plugins.initialize-failed', {
|
||||
pluginName: `${id}::menu`,
|
||||
}),
|
||||
);
|
||||
console.trace(err);
|
||||
}
|
||||
|
||||
@ -39,7 +39,10 @@ export const forceUnloadPreloadPlugin = async (id: string) => {
|
||||
);
|
||||
delete loadedPluginMap[id];
|
||||
} else {
|
||||
console.error(LoggerPrefix, t('common.console.plugins.unload-failed', { pluginName: id }));
|
||||
console.error(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.unload-failed', { pluginName: id }),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -62,9 +65,15 @@ export const forceLoadPreloadPlugin = async (id: string) => {
|
||||
loadedPluginMap[id] = plugin;
|
||||
}
|
||||
|
||||
console.log(LoggerPrefix, t('common.console.plugins.loaded', { pluginName: id }));
|
||||
console.log(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.loaded', { pluginName: id }),
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(LoggerPrefix, t('common.console.plugins.initialize-failed', { pluginName: id }));
|
||||
console.error(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.initialize-failed', { pluginName: id }),
|
||||
);
|
||||
console.trace(err);
|
||||
}
|
||||
};
|
||||
|
||||
@ -4,9 +4,10 @@ import { rendererPlugins } from 'virtual:plugins';
|
||||
|
||||
import { LoggerPrefix, startPlugin, stopPlugin } from '@/utils';
|
||||
|
||||
import { t } from '@/i18n';
|
||||
|
||||
import type { RendererContext } from '@/types/contexts';
|
||||
import type { PluginConfig, PluginDef } from '@/types/plugins';
|
||||
import { t } from '@/i18n';
|
||||
|
||||
const unregisterStyleMap: Record<string, (() => void)[]> = {};
|
||||
const loadedPluginMap: Record<
|
||||
@ -55,9 +56,15 @@ export const forceUnloadRendererPlugin = async (id: string) => {
|
||||
document.querySelector(`style#plugin-${id}`)?.remove();
|
||||
}
|
||||
if (hasStopped || (hasStopped === null && plugin?.renderer)) {
|
||||
console.log(LoggerPrefix, t('common.console.plugins.unloaded', { pluginName: id }));
|
||||
console.log(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.unloaded', { pluginName: id }),
|
||||
);
|
||||
} else {
|
||||
console.error(LoggerPrefix, t('common.console.plugins.unload-failed', { pluginName: id }));
|
||||
console.error(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.unload-failed', { pluginName: id }),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -93,9 +100,15 @@ export const forceLoadRendererPlugin = async (id: string) => {
|
||||
];
|
||||
}
|
||||
|
||||
console.log(LoggerPrefix, t('common.console.plugins.loaded', { pluginName: id }));
|
||||
console.log(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.loaded', { pluginName: id }),
|
||||
);
|
||||
} else {
|
||||
console.log(LoggerPrefix, t('common.console.plugins.initialize-failed', { pluginName: id }));
|
||||
console.log(
|
||||
LoggerPrefix,
|
||||
t('common.console.plugins.initialize-failed', { pluginName: id }),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user