Fixed photo selection bug

This commit is contained in:
dangered wolf 2022-07-25 19:59:40 -04:00
parent 5afb9ffe37
commit d1cdd2caf0
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58
2 changed files with 2 additions and 2 deletions

View file

@ -101,7 +101,7 @@ export const handleStatus = async (
/* Photo renderer */ /* Photo renderer */
if (tweet.media?.photos) { if (tweet.media?.photos) {
const { photos } = tweet.media; const { photos } = tweet.media;
let photo = photos[mediaNumber || 0]; let photo = photos[(mediaNumber || 1) - 1];
if ( if (
typeof mediaNumber !== 'number' && typeof mediaNumber !== 'number' &&

View file

@ -43,7 +43,7 @@ export const translateTweet = async (
console.log(translationResults); console.log(translationResults);
return translationResults; return translationResults;
} catch (e: any) { } catch (e: any) {
console.error('Unknown error while fetching from Translation API'); console.error('Unknown error while fetching from Translation API', e);
return {} as TranslationPartial; // No work to do return {} as TranslationPartial; // No work to do
} }
}; };