From f5baca145176f255dfbb66340b748e362d96d745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 23 Aug 2023 13:47:39 -0400 Subject: [PATCH] fix: #11944, dont refresh page when uninstalling --- public/src/admin/extend/plugins.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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',