Skip to content

Node.js based forum software built for the modern web

refactor: use hooks to update thumb counts

Barış Soner Uşaklı16c43a4d4fdf
diff --git a/install/package.json b/install/package.json
index 242c75a76e..39fa08fa18 100644
--- a/install/package.json
+++ b/install/package.json
@@ -102,7 +102,7 @@
"multer": "2.1.1",
"nconf": "0.13.0",
"nodebb-plugin-2factor": "7.7.1",
- "nodebb-plugin-composer-default": "10.3.30",
+ "nodebb-plugin-composer-default": "10.3.31",
"nodebb-plugin-dbsearch": "6.5.0",
"nodebb-plugin-emoji": "6.0.9",
"nodebb-plugin-emoji-android": "4.1.1",
diff --git a/public/src/modules/topicThumbs.js b/public/src/modules/topicThumbs.js
index 1af367bc1f..424fac316e 100644
--- a/public/src/modules/topicThumbs.js
+++ b/public/src/modules/topicThumbs.js
@@ -68,10 +68,9 @@ define('topicThumbs', [
);
Thumbs.modal.open({ ...payload, modal });
- require(['composer'], (composer) => {
- composer.updateThumbCount(id, $(`[component="composer"][data-uuid="${id}"]`));
- resolve();
- });
+
+ $(window).trigger('action:composer.thumbs.updateCount', { uuid: id });
+ resolve();
});
return false;
},
@@ -103,9 +102,7 @@ define('topicThumbs', [
if (postData && postData.thumbs && postData.thumbs.includes(path)) {
postData.thumbs = postData.thumbs.filter(thumb => thumb !== path);
Thumbs.modal.open(payload);
- require(['composer'], (composer) => {
- composer.updateThumbCount(uuid, $(`[component="composer"][data-uuid="${uuid}"]`));
- });
+ $(window).trigger('action:composer.thumbs.updateCount', { uuid });
}
});
}