Skip to content

Commit

Permalink
Filter out disabled emotes in favorite emotes menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchdev committed Mar 13, 2024
1 parent bd902d9 commit 5fc8629
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions assets/chat/js/emotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export default class EmoteService {
return this.emotes.filter((e) => e.twitch).map((e) => e.prefix);
}

hasEmote(emote) {
return this.emotesMapped.has(emote);
}

getEmote(emote) {
return this.emotesMapped.get(emote);
}
Expand Down
4 changes: 3 additions & 1 deletion assets/chat/js/menus/ChatEmoteMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export default class ChatEmoteMenu extends ChatMenu {
}

buildFavoriteEmoteMenu() {
const favoriteEmotes = [...this.chat.favoriteemotes];
const favoriteEmotes = [...this.chat.favoriteemotes].filter((e) =>
this.chat.emoteService.hasEmote(e),
);
if (favoriteEmotes.length === 0) {
this.favoriteEmoteMenuContent.html(`<div class="emote-container">
<div id="emote-subscribe-note">Favorite Emotes</div>
Expand Down

0 comments on commit 5fc8629

Please sign in to comment.