From 58a31e54c0982658021f31ad9fc493b0b8565bd4 Mon Sep 17 00:00:00 2001 From: Jonny Buchanan Date: Sun, 29 Jan 2023 14:38:24 +1000 Subject: [PATCH] Fixed Blue check in replacement in "user/liked retweeted" notifications (again) Closes #223 --- tweak-new-twitter.user.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tweak-new-twitter.user.js b/tweak-new-twitter.user.js index 5c06c48..a203f85 100644 --- a/tweak-new-twitter.user.js +++ b/tweak-new-twitter.user.js @@ -2624,17 +2624,20 @@ function getTweetType($tweet) { return 'TWEET' } -// Add 1 every time this gets broken: 4 +// Add 1 every time this gets broken: 5 function getVerifiedProps($svg) { let propsGetter = (props) => props?.children?.props?.children?.[0]?.[0]?.props let $parent = $svg.parentElement // Verified badge button on the profile screen - if ($parent.getAttribute('role') == 'button') { + if (isOnProfilePage() && $parent.getAttribute('role') == 'button') { $parent = $parent.closest('span') } // Link variant in "user followed/liked/retweeted" notifications - else if (isOnNotificationsPage() && $parent.parentElement.getAttribute('role') == 'link') { - propsGetter = (props) => props?.children?.[1]?.props + else if (isOnNotificationsPage() && $parent.getAttribute('role') == 'link') { + propsGetter = (props) => { + let linkChildren = props?.children?.props?.children?.[0] + return linkChildren?.[linkChildren.length - 1]?.props + } } if ($parent.wrappedJSObject) { $parent = $parent.wrappedJSObject