fix: #8558, only navigate if user is in same topic

v1.18.x
Barış Soner Uşaklı 5 years ago
parent b5a2e4b69f
commit 79e847d424

@ -21,14 +21,13 @@ define('forum/topic', [
clearTimeout(Topic.replaceURLTimeout);
Topic.replaceURLTimeout = 0;
}
events.removeListeners();
if (!String(data.url).startsWith('topic/')) {
navigator.disable();
components.get('navbar/title').find('span').text('').hide();
app.removeAlert('bookmark');
events.removeListeners();
require(['search'], function (search) {
if (search.topicDOM.active) {
search.topicDOM.end();

@ -83,14 +83,14 @@ define('forum/topic/events', [
}).html(data.post.bookmarks).attr('data-bookmarks', data.post.bookmarks);
}
function onTopicPurged() {
if (ajaxify.data.category && ajaxify.data.category.slug) {
function onTopicPurged(data) {
if (ajaxify.data.category && ajaxify.data.category.slug && parseInt(data.tid, 10) === parseInt(ajaxify.data.tid, 10)) {
ajaxify.go('category/' + ajaxify.data.category.slug, null, true);
}
}
function onTopicMoved(data) {
if (data && data.slug) {
if (data && data.slug && parseInt(data.tid, 10) === parseInt(ajaxify.data.tid, 10)) {
ajaxify.go('topic/' + data.slug, null, true);
}
}

Loading…
Cancel
Save