fix: plugins/installed was displayed as stopped after any edit of the plugin's source

Massimo Melina committed Dec 26, 2022 at 17:57 UTC 8c6c4797c25e3b708df8b7407e2b24a5654d16cd
1 file changed +2 -1
src/plugins.ts
+2 -1
@@ -232,6 +232,7 @@ export async function rescan() {
232 console.log("plugin", id, data.badApi)
233
234 await alreadyRunning?.unload(true)
235 + console.debug("starting plugin", id)
236 const res = await init?.call(null, {
237 srcDir: __dirname,
238 const: Const,
@@ -262,7 +263,7 @@ export async function rescan() {
263 Object.assign(data, res)
264 const plugin = new Plugin(id, data, unwatch)
265 if (alreadyRunning)
265 - events.emit('pluginUpdated', getPluginInfo(id))
266 + events.emit('pluginUpdated', Object.assign(_.pick(plugin, 'started'), getPluginInfo(id)))
267 else {
268 const wasInstalled = availablePlugins[id]
269 if (wasInstalled)