diff --git a/public/src/admin/extend/plugins.js b/public/src/admin/extend/plugins.js index d24830f5b4..818177754a 100644 --- a/public/src/admin/extend/plugins.js +++ b/public/src/admin/extend/plugins.js @@ -309,8 +309,16 @@ define('admin/extend/plugins', [ btn.removeAttr('disabled'); return alerts.error(err); } - - ajaxify.refresh(); + function removeAndUpdateBadge(section) { + $(`${section} [data-plugin-id="${pluginID}"]`).remove(); + const count = $(`${section} [data-plugin-id]`).length; + $(`[data-bs-target="${section}"] .badge`).text(count); + } + if (!pluginData.installed) { + ['#installed', '#active', '#deactive', '#upgrade'].forEach(removeAndUpdateBadge); + } else { + ajaxify.refresh(); + } alerts.alert({ alert_id: 'plugin_toggled',