Check if emotes exist in 7tv api response

This commit is contained in:
Leppunen 2023-04-04 22:30:19 +03:00
parent e01da40bea
commit 5a330acabc
2 changed files with 2 additions and 2 deletions

View file

@ -29,7 +29,7 @@ export function use7tvChannelEmotes(channelId: string): Array<ThirdPartyEmote> {
const emotes = [];
for (const channelEmote of data?.emote_set.emotes ?? []) {
for (const channelEmote of data?.emote_set?.emotes ?? []) {
const webpEmotes = channelEmote.data.host.files.filter(i => i.format === 'WEBP');
const emoteURL = channelEmote.data.host.url;
emotes.push({

View file

@ -6,7 +6,7 @@ interface StvGlobal {
}
interface StvChannel {
emote_set: StvEmoteSet;
emote_set: StvEmoteSet | null;
}
interface StvEmoteSet {