Skip to content

Commit

Permalink
fix: #8558, only navigate if user is in same topic
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Aug 11, 2020
1 parent b5a2e4b commit 79e847d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions public/src/client/topic.js
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions public/src/client/topic/events.js
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 79e847d

Please sign in to comment.