mirror of
https://github.com/insin/control-panel-for-twitter.git
synced 2025-06-19 07:05:32 -04:00
- 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:
parent
6b5125d73f
commit
571718faa9
21
script.js
21
script.js
@ -5449,8 +5449,6 @@ function onIndividualTweetTimelineChange($timeline, options) {
|
|||||||
let hiddenItemTypes = {}
|
let hiddenItemTypes = {}
|
||||||
let processedCount = 0
|
let processedCount = 0
|
||||||
|
|
||||||
/** @type {Element} */
|
|
||||||
let $previousItem
|
|
||||||
/** @type {?boolean} */
|
/** @type {?boolean} */
|
||||||
let hidPreviousItem
|
let hidPreviousItem
|
||||||
/** @type {boolean} */
|
/** @type {boolean} */
|
||||||
@ -5467,9 +5465,21 @@ function onIndividualTweetTimelineChange($timeline, options) {
|
|||||||
let $focusedTweet
|
let $focusedTweet
|
||||||
|
|
||||||
for (let $item of $timeline.children) {
|
for (let $item of $timeline.children) {
|
||||||
if (seen.has($item)) {
|
if (seen.has($item) &&
|
||||||
$previousItem = $item
|
// Reprocess Discover More Tweets if they were processed before the Discover More heading
|
||||||
hidPreviousItem = seen.get($previousItem).hidden
|
!(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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5650,7 +5660,6 @@ function onIndividualTweetTimelineChange($timeline, options) {
|
|||||||
warn('unhandled timeline item', {$item, itemType, hideItem})
|
warn('unhandled timeline item', {$item, itemType, hideItem})
|
||||||
}
|
}
|
||||||
|
|
||||||
$previousItem = $item
|
|
||||||
hidPreviousItem = hideItem
|
hidPreviousItem = hideItem
|
||||||
seen.set($item, {itemType, hidden: hideItem})
|
seen.set($item, {itemType, hidden: hideItem})
|
||||||
processedCount++
|
processedCount++
|
||||||
|
Loading…
Reference in New Issue
Block a user