diff --git a/src/plugins/index.ts b/src/plugins/index.ts index 3291885c1..a434b4a6f 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -170,13 +170,14 @@ export const startPlugin = traceFunction("startPlugin", function startPlugin(p: } try { p.start(); - p.started = true; } catch (e) { logger.error(`Failed to start ${name}\n`, e); return false; } } + p.started = true; + if (commands?.length) { logger.debug("Registering commands of plugin", name); for (const cmd of commands) { @@ -206,6 +207,7 @@ export const startPlugin = traceFunction("startPlugin", function startPlugin(p: export const stopPlugin = traceFunction("stopPlugin", function stopPlugin(p: Plugin) { const { name, commands, flux, contextMenus } = p; + if (p.stop) { logger.info("Stopping plugin", name); if (!p.started) { @@ -214,13 +216,14 @@ export const stopPlugin = traceFunction("stopPlugin", function stopPlugin(p: Plu } try { p.stop(); - p.started = false; } catch (e) { logger.error(`Failed to stop ${name}\n`, e); return false; } } + p.started = false; + if (commands?.length) { logger.debug("Unregistering commands of plugin", name); for (const cmd of commands) {