Skip to content

Commit

Permalink
Fix selecting wrong tweet
Browse files Browse the repository at this point in the history
  • Loading branch information
JorikSchellekens committed Feb 6, 2025
1 parent c9824a8 commit fefd299
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export const PaymentModal = ({
try {
const tweetIdBigInt = BigInt(tweetId);

// Find the tweet element and get its text
const tweetElement = document.querySelector(`article[data-testid="tweet"]`)
// Find the specific tweet by ID
const tweetElement = document.querySelector(`article[data-testid="tweet"] a[href*="/${tweetId}"]`)?.closest('article[data-testid="tweet"]')
const tweetTextElement = tweetElement?.querySelector(SELECTORS.TWEET_TEXT)
const tweetText = tweetTextElement?.textContent || ''

Expand All @@ -98,7 +98,6 @@ export const PaymentModal = ({
return undefined
}

console.log('tweetText', cleanPromptText(tweetText))
return [
tokenContract.populate("approve", [
agentContract.address,
Expand Down

0 comments on commit fefd299

Please sign in to comment.