Removed ability to reload emotes really fast (#3450)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -913,6 +913,15 @@ void SplitHeader::themeChangedEvent()
|
||||
|
||||
void SplitHeader::reloadChannelEmotes()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
if (this->lastReloadedChannelEmotes_ + 30s > now)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->lastReloadedChannelEmotes_ = now;
|
||||
|
||||
auto channel = this->split_->getChannel();
|
||||
|
||||
if (auto twitchChannel = dynamic_cast<TwitchChannel *>(channel.get()))
|
||||
@@ -924,6 +933,15 @@ void SplitHeader::reloadChannelEmotes()
|
||||
|
||||
void SplitHeader::reloadSubscriberEmotes()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
if (this->lastReloadedSubEmotes_ + 30s > now)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->lastReloadedSubEmotes_ = now;
|
||||
|
||||
auto channel = this->split_->getChannel();
|
||||
getApp()->accounts->twitch.getCurrent()->loadEmotes(channel);
|
||||
}
|
||||
|
||||
@@ -64,6 +64,8 @@ private:
|
||||
bool isLive_{false};
|
||||
QString thumbnail_;
|
||||
QElapsedTimer lastThumbnail_;
|
||||
std::chrono::steady_clock::time_point lastReloadedChannelEmotes_;
|
||||
std::chrono::steady_clock::time_point lastReloadedSubEmotes_;
|
||||
|
||||
// ui
|
||||
Button *dropdownButton_{};
|
||||
|
||||
Reference in New Issue
Block a user