Fix rare case where 7TV emotes don't show

7TV emotes are locked to 4x size, but if that doesn't exist an exception
is thrown. The lack of 4x size seems to
be caused by a new emote still in processing.
This commit is contained in:
Tommy Chow 2023-11-30 17:59:43 -05:00
parent 1a55bd2e63
commit 364b94411d

View file

@ -261,9 +261,10 @@ class Emote {
final emoteData = emote.data; final emoteData = emote.data;
final url = emoteData!.host.url; final url = emoteData!.host.url;
// Flutter doesn't support AVIF yet. // Flutter doesn't support AVIF yet.
final file = emoteData.host.files.reversed.firstWhere( final file = emoteData.host.files.lastWhere(
(file) => file.format != 'AVIF' && file.name.contains('4x'), (file) => file.format != 'AVIF',
); );
// Check if the flag has 1 at the 8th bit. // Check if the flag has 1 at the 8th bit.