diff --git a/src/providers/twitch/TwitchAccount.cpp b/src/providers/twitch/TwitchAccount.cpp index b5930529..13b4d409 100644 --- a/src/providers/twitch/TwitchAccount.cpp +++ b/src/providers/twitch/TwitchAccount.cpp @@ -482,6 +482,10 @@ void TwitchAccount::parseEmotes(const rapidjson::Document &root) emoteData->emotes.emplace(code, emote); } + std::sort(emoteSet->emotes.begin(), emoteSet->emotes.end(), + [](const TwitchEmote &l, const TwitchEmote &r) { + return l.name.string < r.name.string; + }); emoteData->emoteSets.emplace_back(emoteSet); } }; diff --git a/src/widgets/dialogs/EmotePopup.cpp b/src/widgets/dialogs/EmotePopup.cpp index 00beb11c..c000e3ec 100644 --- a/src/widgets/dialogs/EmotePopup.cpp +++ b/src/widgets/dialogs/EmotePopup.cpp @@ -32,7 +32,14 @@ namespace { if (!map.empty()) { - for (const auto &emote : map) + std::vector> vec(map.begin(), + map.end()); + std::sort(vec.begin(), vec.end(), + [](const std::pair &l, + const std::pair &r) { + return l.first.string < r.first.string; + }); + for (const auto &emote : vec) { builder .emplace(emote.second,