Skip to content

Commit

Permalink
fix: update thumb count when removing thumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed May 17, 2024
1 parent 17ea61a commit 6214336
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion public/src/modules/topicThumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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);
});
}
Expand Down

0 comments on commit 6214336

Please sign in to comment.