diff --git a/lib/screens/channel/chat/stores/chat_assets_store.dart b/lib/screens/channel/chat/stores/chat_assets_store.dart index c11bc401..fed99093 100644 --- a/lib/screens/channel/chat/stores/chat_assets_store.dart +++ b/lib/screens/channel/chat/stores/chat_assets_store.dart @@ -141,22 +141,6 @@ abstract class ChatAssetsStoreBase with Store { // // Emotes Future.wait([ - twitchApi - .getSharedChatSession( - broadcasterId: channelId, - headers: headers, - ) - .then((sharedChatSession) { - if (sharedChatSession == null) return; - - for (final participant in sharedChatSession.participants) { - twitchApi - .getUser(id: participant.broadcasterId, headers: headers) - .then((user) { - channelIdToUserTwitch[participant.broadcasterId] = user; - }); - } - }).catchError(onBadgeError), Future.wait([ if (showTwitchEmotes) ...[ twitchApi @@ -180,7 +164,7 @@ abstract class ChatAssetsStoreBase with Store { final (setId, emotes) = data; sevenTvEmoteSetId = setId; return emotes; - }).catchError(onBadgeError), + }).catchError(onEmoteError), ], if (showBTTVEmotes) ...[ bttvApi.getEmotesGlobal().catchError(onEmoteError), @@ -200,8 +184,24 @@ abstract class ChatAssetsStoreBase with Store { for (final emote in emotes) emote.name: emote, }.asObservable(), ), - //Emotes + // Badges Future.wait([ + twitchApi + .getSharedChatSession( + broadcasterId: channelId, + headers: headers, + ) + .then((sharedChatSession) { + if (sharedChatSession == null) return; + + for (final participant in sharedChatSession.participants) { + twitchApi + .getUser(id: participant.broadcasterId, headers: headers) + .then((user) { + channelIdToUserTwitch[participant.broadcasterId] = user; + }); + } + }).catchError(onBadgeError), // Get global badges first, then channel badges to avoid badge conflicts. // We want the channel badges to override the global badges. if (showTwitchBadges) diff --git a/lib/screens/channel/chat/stores/chat_store.dart b/lib/screens/channel/chat/stores/chat_store.dart index 7148990f..57fbf7d1 100644 --- a/lib/screens/channel/chat/stores/chat_store.dart +++ b/lib/screens/channel/chat/stores/chat_store.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:frosty/apis/twitch_api.dart'; +import 'package:frosty/models/badges.dart'; import 'package:frosty/models/emotes.dart'; import 'package:frosty/models/events.dart'; import 'package:frosty/models/irc.dart'; @@ -435,7 +436,7 @@ abstract class ChatStoreBase with Store { }, onBadgeError: (error) { debugPrint(error.toString()); - return []; + return []; }, showTwitchEmotes: settings.showTwitchEmotes, showTwitchBadges: settings.showTwitchBadges,