mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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) => {
|
Thumbs.modal.handleDelete = (payload) => {
|
||||||
const modalEl = payload.modal.get(0);
|
const modalEl = payload.modal.get(0);
|
||||||
|
const { id: uuid } = payload;
|
||||||
modalEl.addEventListener('click', (ev) => {
|
modalEl.addEventListener('click', (ev) => {
|
||||||
if (ev.target.closest('button[data-action="remove"]')) {
|
if (ev.target.closest('button[data-action="remove"]')) {
|
||||||
bootbox.confirm('[[modules:thumbs.modal.confirm-remove]]', (ok) => {
|
bootbox.confirm('[[modules:thumbs.modal.confirm-remove]]', (ok) => {
|
||||||
@@ -101,6 +101,9 @@ define('topicThumbs', [
|
|||||||
path: path,
|
path: path,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
Thumbs.modal.open(payload);
|
Thumbs.modal.open(payload);
|
||||||
|
require(['composer'], (composer) => {
|
||||||
|
composer.updateThumbCount(uuid, $(`[component="composer"][data-uuid="${uuid}"]`));
|
||||||
|
});
|
||||||
}).catch(alerts.error);
|
}).catch(alerts.error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user