- Fixed Discover More Tweets not being hidden when they render before the Discover More heading

- Fixed Premium blue check Tweets the focused Tweet is a reply to being hidden
This commit is contained in:
Jonny Buchanan 2025-06-14 13:27:26 +10:00
parent 6b5125d73f
commit 571718faa9

View File

@ -5449,8 +5449,6 @@ function onIndividualTweetTimelineChange($timeline, options) {
let hiddenItemTypes = {}
let processedCount = 0
/** @type {Element} */
let $previousItem
/** @type {?boolean} */
let hidPreviousItem
/** @type {boolean} */
@ -5467,9 +5465,21 @@ function onIndividualTweetTimelineChange($timeline, options) {
let $focusedTweet
for (let $item of $timeline.children) {
if (seen.has($item)) {
$previousItem = $item
hidPreviousItem = seen.get($previousItem).hidden
if (seen.has($item) &&
// Reprocess Discover More Tweets if they were processed before the Discover More heading
!(hideAllSubsequentItems && seen.get($item).hidden != config.hideMoreTweets)) {
let details = seen.get($item)
hidPreviousItem = details.hidden
// The focused Tweet renders before any Tweets it was a reply to
if (details.itemType == 'FOCUSED_TWEET') {
changes = []
hiddenItemCount = 0
hiddenItemTypes = {}
}
// The Discover More heading renders after Discover more Tweets(?)
else if (details.itemType == 'DISCOVER_MORE_HEADING') {
hideAllSubsequentItems = config.hideMoreTweets
}
continue
}
@ -5650,7 +5660,6 @@ function onIndividualTweetTimelineChange($timeline, options) {
warn('unhandled timeline item', {$item, itemType, hideItem})
}
$previousItem = $item
hidPreviousItem = hideItem
seen.set($item, {itemType, hidden: hideItem})
processedCount++