diff --git a/src/api.ts b/src/api.ts index bf647eb..f05d2a9 100644 --- a/src/api.ts +++ b/src/api.ts @@ -142,7 +142,11 @@ export const statusAPI = async ( event: FetchEvent ): Promise => { const conversation = await fetchConversation(status, event); - const tweet = conversation?.globalObjects?.tweets?.[status] || {}; + let tweet = conversation?.globalObjects?.tweets?.[status] || {}; + + if (tweet.retweeted_status_id_str) { + tweet = conversation?.globalObjects?.tweets?.[tweet.retweeted_status_id_str] || {}; + } /* Fallback for if Tweet did not load */ if (typeof tweet.full_text === 'undefined') { diff --git a/src/types/twitterTypes.d.ts b/src/types/twitterTypes.d.ts index 5a1fb54..279eeff 100644 --- a/src/types/twitterTypes.d.ts +++ b/src/types/twitterTypes.d.ts @@ -149,6 +149,8 @@ type TweetPartial = { source: string; full_text: string; user_id_str: string; + retweeted_status_id: number; + retweeted_status_id_str: string; user?: UserPartial; };