Skip to content

Commit

Permalink
Add more characters to the quick test for like and reply icons
Browse files Browse the repository at this point in the history
This same approach would have produced false positives for the verified icon, which starts with the same 4 characters as the home icon
  • Loading branch information
insin committed Jul 24, 2021
1 parent c175271 commit ceb9a90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tweak-new-twitter.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,8 +1281,8 @@ function getTweetType($tweet) {
if ($tweet.previousElementSibling?.querySelector('[data-testid="socialContext"]')) {
if (!config.alwaysUseLatestTweets && currentMainTimelineType == getString('HOME')) {
let svgPath = $tweet.previousElementSibling.querySelector('svg path')?.getAttribute('d') ?? ''
if (svgPath.startsWith('M12')) return 'LIKED'
if (svgPath.startsWith('M14')) return 'REPLIED'
if (svgPath.startsWith('M12 21.638h-.014C9.403 21.59')) return 'LIKED'
if (svgPath.startsWith('MM14.046 2.242l-4.148-.01h-.')) return 'REPLIED'
// Retweet is M23, but we want it to be the fallback if these SVGs are changed
}
return 'RETWEET'
Expand Down

0 comments on commit ceb9a90

Please sign in to comment.