mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
fix: #8558, only navigate if user is in same topic
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user