mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: update thumb count when removing thumbs
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user