Skip to content

Commit fefd299

Browse files
Fix selecting wrong tweet
1 parent c9824a8 commit fefd299

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

extension/src/content-script/components/modals/PaymentModal.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export const PaymentModal = ({
8484
try {
8585
const tweetIdBigInt = BigInt(tweetId);
8686

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

@@ -98,7 +98,6 @@ export const PaymentModal = ({
9898
return undefined
9999
}
100100

101-
console.log('tweetText', cleanPromptText(tweetText))
102101
return [
103102
tokenContract.populate("approve", [
104103
agentContract.address,

0 commit comments

Comments
 (0)