mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-05-04 10:43:49 +01:00
Fix missing quotes breaking things
This commit is contained in:
parent
fecac910b8
commit
2409a50d41
1 changed files with 10 additions and 3 deletions
|
@ -149,14 +149,21 @@ export const buildAPITweet = async (
|
||||||
/* We found a quote tweet, let's process that too */
|
/* We found a quote tweet, let's process that too */
|
||||||
const quoteTweet = tweet.quoted_status_result;
|
const quoteTweet = tweet.quoted_status_result;
|
||||||
if (quoteTweet) {
|
if (quoteTweet) {
|
||||||
apiTweet.quote = (await buildAPITweet(
|
const buildQuote = (await buildAPITweet(
|
||||||
quoteTweet,
|
quoteTweet,
|
||||||
language,
|
language,
|
||||||
threadPiece,
|
threadPiece,
|
||||||
legacyAPI
|
legacyAPI
|
||||||
)) as APITweet;
|
));
|
||||||
|
if ((buildQuote as FetchResults).status) {
|
||||||
|
apiTweet.quote = undefined
|
||||||
|
} else {
|
||||||
|
apiTweet.quote = buildQuote as APITweet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Only override the embed_card if it's a basic tweet, since media always takes precedence */
|
/* Only override the embed_card if it's a basic tweet, since media always takes precedence */
|
||||||
if (apiTweet.embed_card === 'tweet' && apiTweet.quote !== null) {
|
if (apiTweet.embed_card === 'tweet' && typeof apiTweet.quote !== 'undefined') {
|
||||||
apiTweet.embed_card = apiTweet.quote.embed_card;
|
apiTweet.embed_card = apiTweet.quote.embed_card;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue