From 850cfb33f57d99127bdf73edaf4c9e55afa3ac4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 8 Aug 2023 14:10:18 -0400 Subject: [PATCH] fix: use config.undoTimeout instead of hardcoded value if user is in the target topic and they only moved 1 post show that post after moving update target tid as user navigates different topics --- public/src/client/topic/move-post.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/src/client/topic/move-post.js b/public/src/client/topic/move-post.js index 5d02be63ee..490c0cefec 100644 --- a/public/src/client/topic/move-post.js +++ b/public/src/client/topic/move-post.js @@ -50,7 +50,7 @@ define('forum/topic/move-post', [ title: '[[topic:thread_tools.move-posts]]', message: '[[topic:topic_move_posts_success]]', type: 'success', - timeout: 10000, + timeout: config.undoTimeout, timeoutfn: function () { movePosts(data); }, @@ -78,7 +78,7 @@ define('forum/topic/move-post', [ ) { targetTid = ajaxify.data.tid; } - if (targetTid && !tidInput.val()) { + if (targetTid) { tidInput.val(targetTid); } checkMoveButtonEnable(); @@ -149,7 +149,10 @@ define('forum/topic/move-post', [ $(this).remove(); }); }); - + if (data.pids.length === 1 && ajaxify.data.template.topic && + parseInt(data.tid, 10) === parseInt(ajaxify.data.tid, 10)) { + ajaxify.go(`/post/${data.pids[0]}`); + } closeMoveModal(); }).catch(alerts.error); }