diff options
Diffstat (limited to 'frontend/src/plugin-loader.tsx')
| -rw-r--r-- | frontend/src/plugin-loader.tsx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx index fd4dc1c0..f0a358ef 100644 --- a/frontend/src/plugin-loader.tsx +++ b/frontend/src/plugin-loader.tsx @@ -38,6 +38,7 @@ import { checkForPluginUpdates } from './store'; import TabsHook from './tabs-hook'; import Toaster from './toaster'; import { getVersionInfo } from './updater'; +import { getPluginDisplayName } from './utils/pluginHelpers'; import { getSetting, setSetting } from './utils/settings'; import TranslationHelper, { TranslationClass } from './utils/TranslationHelper'; @@ -343,7 +344,7 @@ class PluginLoader extends Logger { public dismountAll() { for (const plugin of this.plugins) { - this.log(`Dismounting ${plugin.name}`); + this.log(`Dismounting ${getPluginDisplayName(plugin.name, plugin.version)}`); plugin.onDismount?.(); } } @@ -403,14 +404,14 @@ class PluginLoader extends Logger { timeoutMS?: number, ) { if (useQueue && this.reloadLock) { - this.log('Reload currently in progress, adding to queue', name); + this.log(`Reload currently in progress, adding ${getPluginDisplayName(name, version)} to queue`); this.pluginReloadQueue.push({ name, version: version, loadType }); return; } try { if (useQueue) this.reloadLock = true; - this.log(`Trying to load ${name}`); + this.log(`Trying to load ${getPluginDisplayName(name, version)}`); this.unloadPlugin(name, true); const startTime = performance.now(); @@ -420,7 +421,7 @@ class PluginLoader extends Logger { this.deckyState.setDisabledPlugins(this.deckyState.publicState().disabledPlugins.filter((d) => d.name !== name)); this.deckyState.setPlugins(this.plugins); - this.log(`Loaded ${name} in ${endTime - startTime}ms`); + this.log(`Loaded ${getPluginDisplayName(name, version)} in ${endTime - startTime}ms`); } catch (e) { throw e; } finally { @@ -502,16 +503,17 @@ class PluginLoader extends Logger { version: version, loadType, }); - } else throw new Error(`${name} frontend_bundle not OK`); + } else throw new Error(`${getPluginDisplayName(name, version)} frontend_bundle not OK`); break; default: - throw new Error(`${name} has no defined loadType.`); + throw new Error(`${getPluginDisplayName(name, version)} has no defined loadType.`); } } catch (e) { if (e === timeoutException) throw timeoutException; - this.error('Error loading plugin ' + name, e); + this.error(`Error loading plugin ${getPluginDisplayName(name, version)}`, e); + const TheError: FC<{}> = () => ( <PanelSection> <PanelSectionRow> @@ -731,7 +733,8 @@ class PluginLoader extends Logger { backendAPI.useQuickAccessVisible = useQuickAccessVisible; } - this.debug(`${pluginName} connected to loader API.`); + // Note: version info not available at connection time + this.debug(`Plugin ${pluginName} connected to loader API.`); return backendAPI; }, }; |
