mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix: Twitch global emotes not loading (#5144)
This commit is contained in:
parent
d0c321e19f
commit
ab7e6e0281
|
@ -113,7 +113,7 @@
|
|||
- Dev: Move `clang-tidy` checker to its own CI job. (#4996)
|
||||
- Dev: Refactored the Image Uploader feature. (#4971)
|
||||
- Dev: Refactored the SplitOverlay code. (#5082)
|
||||
- Dev: Refactored the TwitchBadges structure, making it less of a singleton. (#5096)
|
||||
- Dev: Refactored the TwitchBadges structure, making it less of a singleton. (#5096, #5144)
|
||||
- Dev: Refactored emotes out of TwitchIrcServer. (#5120)
|
||||
- Dev: Refactored the ChatterinoBadges structure, making it less of a singleton. (#5103)
|
||||
- Dev: Refactored the ColorProvider class a bit. (#5112)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -204,6 +204,10 @@ void Application::initialize(Settings &settings, const Paths &paths)
|
|||
singleton->initialize(settings, paths);
|
||||
}
|
||||
|
||||
// XXX: Loading Twitch badges after Helix has been initialized, which only happens after
|
||||
// the AccountController initialize has been called
|
||||
this->twitchBadges->loadTwitchBadges();
|
||||
|
||||
// Show crash message.
|
||||
// On Windows, the crash message was already shown.
|
||||
#ifndef Q_OS_WIN
|
||||
|
|
|
@ -20,21 +20,10 @@
|
|||
|
||||
namespace chatterino {
|
||||
|
||||
TwitchBadges::TwitchBadges()
|
||||
{
|
||||
this->loadTwitchBadges();
|
||||
}
|
||||
|
||||
void TwitchBadges::loadTwitchBadges()
|
||||
{
|
||||
assert(this->loaded_ == false);
|
||||
|
||||
if (!getHelix())
|
||||
{
|
||||
// This is intended for tests and benchmarks.
|
||||
return;
|
||||
}
|
||||
|
||||
getHelix()->getGlobalBadges(
|
||||
[this](auto globalBadges) {
|
||||
auto badgeSets = this->badgeSets_.access();
|
||||
|
|
|
@ -32,8 +32,6 @@ class TwitchBadges
|
|||
using BadgeIconCallback = std::function<void(QString, const QIconPtr)>;
|
||||
|
||||
public:
|
||||
TwitchBadges();
|
||||
|
||||
// Get badge from name and version
|
||||
std::optional<EmotePtr> badge(const QString &set,
|
||||
const QString &version) const;
|
||||
|
@ -45,8 +43,9 @@ public:
|
|||
void getBadgeIcons(const QList<DisplayBadge> &badges,
|
||||
BadgeIconCallback callback);
|
||||
|
||||
private:
|
||||
void loadTwitchBadges();
|
||||
|
||||
private:
|
||||
void parseTwitchBadges(QJsonObject root);
|
||||
void loaded();
|
||||
void loadEmoteImage(const QString &name, ImagePtr image,
|
||||
|
|
Loading…
Reference in a new issue