Skip to content

Node.js based forum software built for the modern web

fix: update thumb count when removing thumbs

Barış Soner Uşaklı6214336ce12a
diff --git a/public/src/modules/topicThumbs.js b/public/src/modules/topicThumbs.js
index 8c4305abaa..21869fe1a5 100644
--- a/public/src/modules/topicThumbs.js
+++ b/public/src/modules/topicThumbs.js
@@ -87,7 +87,7 @@ define('topicThumbs', [
Thumbs.modal.handleDelete = (payload) => {
const modalEl = payload.modal.get(0);
-
+ const { id: uuid } = payload;
modalEl.addEventListener('click', (ev) => {
if (ev.target.closest('button[data-action="remove"]')) {
bootbox.confirm('[[modules:thumbs.modal.confirm-remove]]', (ok) => {
@@ -101,6 +101,9 @@ define('topicThumbs', [
path: path,
}).then(() => {
Thumbs.modal.open(payload);
+ require(['composer'], (composer) => {
+ composer.updateThumbCount(uuid, $(`[component="composer"][data-uuid="${uuid}"]`));
+ });
}).catch(alerts.error);
});
}