This commit is contained in:
dangered wolf 2022-08-05 16:48:32 -04:00
parent 6eed8f9d4e
commit 4fa983b8ea
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58

View file

@ -52,7 +52,8 @@ export const handleStatus = async (
if (tweet.media.video) { if (tweet.media.video) {
redirectUrl = tweet.media.video.url; redirectUrl = tweet.media.video.url;
} else if (tweet.media.photos) { } else if (tweet.media.photos) {
redirectUrl = (tweet.media.photos[mediaNumber || 0] || tweet.media.photos[0]).url; const photos = tweet.media.photos;
redirectUrl = (photos[(mediaNumber || 1) - 1] || photos[0]).url;
} }
if (redirectUrl) { if (redirectUrl) {
return { response: Response.redirect(redirectUrl, 302) }; return { response: Response.redirect(redirectUrl, 302) };