From 449366ca834ad433f0a6f914f6bef045241a80d7 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 19 Nov 2021 12:20:48 -0500 Subject: [PATCH] fix: consolidate plugin reset logic --- src/cli/reset.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/cli/reset.js b/src/cli/reset.js index 290f5bf7a2..7d4c7e9e2a 100644 --- a/src/cli/reset.js +++ b/src/cli/reset.js @@ -119,14 +119,10 @@ async function resetPlugin(pluginId) { const isActive = await db.isSortedSetMember('plugins:active', pluginId); if (isActive) { await db.sortedSetRemove('plugins:active', pluginId); - } - - await events.log({ - type: 'plugin-deactivate', - text: pluginId, - }); - - if (isActive) { + await events.log({ + type: 'plugin-deactivate', + text: pluginId, + }); winston.info('[reset] Plugin `%s` disabled', pluginId); } else { winston.warn('[reset] Plugin `%s` was not active on this forum', pluginId);