Skip to content

Commit

Permalink
Merge pull request #141 from BuidlerDAO/nig-798
Browse files Browse the repository at this point in the history
fix: nig-798
  • Loading branch information
huangbinjie authored May 11, 2024
2 parents 44c0895 + a5202a0 commit 70f0a67
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/content/addToTwitterHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export const addPriceComponent = (element: Element, tweetId: string, twitterUser

export const addVoteComponent = (element: Element, tweetId: string, userName: string) => {
const voteContainer = document.createElement('div');
const repostContainer = element.querySelector<HTMLDivElement>(
'article > div >div > div:nth-child(1)'
);
// 如果是转发的话,目前 innerText 会是 You reposted,判断如果有内容不管是什么文案我们就认为是转发的
const isRepost = repostContainer && repostContainer.innerText !== '';
// 如果是转发不要附加 vote 组件
if (isRepost) return;
const specificElement = element.querySelector(
'article > div > div > div:nth-child(2) > div:nth-child(2) > div:nth-child(4) > div > div'
);
Expand Down

0 comments on commit 70f0a67

Please sign in to comment.