Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: only autoload thread when we are wathing its forum
  • Loading branch information
ckruse committed Jun 23, 2019
1 parent bfd7233 commit a02e480
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/js/autoload_threads/autoloading.js
Expand Up @@ -45,6 +45,11 @@ const insertRenderedThread = (thread, message, html) => {

const autoloadMessage = ev => {
const { thread, message, forum } = ev.detail.data;

if (!["all", forum.slug].includes(document.body.dataset.currentForum)) {
return;
}

const slug = document.body.dataset.currentForum === "all" ? "all" : forum.slug;

NEW_MESSAGES.push(message.message_id);
Expand Down

0 comments on commit a02e480

Please sign in to comment.