diff --git a/app/assets/javascripts/discourse/app/lib/url.js b/app/assets/javascripts/discourse/app/lib/url.js index 622911c4173..1d979f4c568 100644 --- a/app/assets/javascripts/discourse/app/lib/url.js +++ b/app/assets/javascripts/discourse/app/lib/url.js @@ -117,6 +117,15 @@ const DiscourseURL = EmberObject.extend({ if (!holder) { selector = holderId; + + if ( + document.getElementsByClassName( + `topic-post-visited-line post-${postNumber - 1}` + )?.length === 1 + ) { + selector = ".small-action.topic-post-visited"; + } + holder = document.querySelector(selector); }