fix: check tid in event handlers client side

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 03329408b7
commit 9dac9630df

@ -96,7 +96,7 @@ define('forum/topic/events', [
} }
function onPostEdited(data) { function onPostEdited(data) {
if (!data || !data.post) { if (!data || !data.post || parseInt(data.post.tid, 10) !== parseInt(ajaxify.data.tid, 10)) {
return; return;
} }
var editedPostEl = components.get('post/content', data.post.pid).filter(function (index, el) { var editedPostEl = components.get('post/content', data.post.pid).filter(function (index, el) {
@ -174,6 +174,9 @@ define('forum/topic/events', [
} }
function onPostPurged(postData) { function onPostPurged(postData) {
if (!postData || parseInt(postData.tid, 10) !== parseInt(ajaxify.data.tid, 10)) {
return;
}
components.get('post', 'pid', postData.pid).fadeOut(500, function () { components.get('post', 'pid', postData.pid).fadeOut(500, function () {
$(this).remove(); $(this).remove();
posts.showBottomPostBar(); posts.showBottomPostBar();

Loading…
Cancel
Save