From 364b94411d25ea5c6db09bce5ec70c8a300b4e4c Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Thu, 30 Nov 2023 17:59:43 -0500 Subject: [PATCH] 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. --- lib/models/emotes.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/models/emotes.dart b/lib/models/emotes.dart index e5a00edc..1f6538c1 100644 --- a/lib/models/emotes.dart +++ b/lib/models/emotes.dart @@ -261,9 +261,10 @@ class Emote { final emoteData = emote.data; final url = emoteData!.host.url; + // Flutter doesn't support AVIF yet. - final file = emoteData.host.files.reversed.firstWhere( - (file) => file.format != 'AVIF' && file.name.contains('4x'), + final file = emoteData.host.files.lastWhere( + (file) => file.format != 'AVIF', ); // Check if the flag has 1 at the 8th bit.