mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-04-05 18:40:56 +01:00
Don't include failed translations
This commit is contained in:
parent
f95ffb0393
commit
2652861cd7
1 changed files with 7 additions and 5 deletions
12
src/api.ts
12
src/api.ts
|
@ -123,11 +123,13 @@ const populateTweetProperties = async (
|
||||||
conversation.guestToken || '',
|
conversation.guestToken || '',
|
||||||
language
|
language
|
||||||
);
|
);
|
||||||
apiTweet.translation = {
|
if (translateAPI !== null) {
|
||||||
text: translateAPI?.translation || '',
|
apiTweet.translation = {
|
||||||
source_lang: translateAPI?.sourceLanguage || '',
|
text: translateAPI?.translation || '',
|
||||||
target_lang: translateAPI?.destinationLanguage || ''
|
source_lang: translateAPI?.sourceLanguage || '',
|
||||||
};
|
target_lang: translateAPI?.destinationLanguage || ''
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiTweet;
|
return apiTweet;
|
||||||
|
|
Loading…
Add table
Reference in a new issue