Node.js based forum software built for the modern web
feat: add confirm to reject, closes #10427
Barış Soner Uşaklı538ad9e18bb1
diff --git a/public/language/en-GB/post-queue.json b/public/language/en-GB/post-queue.jsonindex 9ab4fc3ba7..85bda81ac3 100644--- a/public/language/en-GB/post-queue.json+++ b/public/language/en-GB/post-queue.json@@ -17,5 +17,6 @@"reject": "Reject","remove": "Remove","notify": "Notify",- "notify-user": "Notify User"+ "notify-user": "Notify User",+ "confirm-reject": "Do you want to reject this post?"}\ No newline at end of filediff --git a/public/src/client/post-queue.js b/public/src/client/post-queue.jsindex 0be5043450..f5c471ca30 100644--- a/public/src/client/post-queue.js+++ b/public/src/client/post-queue.js@@ -33,12 +33,17 @@ define('forum/post-queue', [});});}+ function confirmReject() {+ return new Promise((resolve) => {+ bootbox.confirm('[[post-queue:confirm-reject]]', resolve);+ });+ }const parent = $(this).parents('[data-id]');const action = $(this).attr('data-action');const id = parent.attr('data-id');const listContainer = parent.get(0).parentNode;- if (!['accept', 'reject', 'notify'].includes(action)) {+ if ((!['accept', 'reject', 'notify'].includes(action)) || (action === 'reject' && !await confirmReject())) {return;}