Reset the timer & refresh thumbnail when changing split channel (#2080)

This commit is contained in:
pajlada 2020-10-18 12:19:30 +02:00 committed by GitHub
parent 48a3506d77
commit 39a0e69a3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -31,6 +31,7 @@
- Bugfix: Fixed timestamps being incorrect on some messages loaded from the recent-messages service on startup (#1286, #2020)
- Bugfix: Fixed timestamps missing on channel point redemption messages (#1943)
- Bugfix: Fixed tooltip didn't show in `EmotePopup` depending on the `Link preview` setting enabled or no (#2008)
- Bugfix: Fixed Stream thumbnail not updating after using the "Change channel" feature (#2074, #2080)
## 2.2.0

View file

@ -587,16 +587,27 @@ void SplitHeader::initializeModeSignals(EffectLabel &label)
});
}
void SplitHeader::resetThumbnail()
{
this->lastThumbnail_.invalidate();
this->thumbnail_.clear();
}
void SplitHeader::handleChannelChanged()
{
this->resetThumbnail();
this->updateChannelText();
this->channelConnections_.clear();
auto channel = this->split_->getChannel();
if (auto twitchChannel = dynamic_cast<TwitchChannel *>(channel.get()))
{
this->channelConnections_.emplace_back(
twitchChannel->liveStatusChanged.connect(
[this]() { this->updateChannelText(); }));
twitchChannel->liveStatusChanged.connect([this]() {
this->updateChannelText(); //
}));
}
}

View file

@ -48,6 +48,13 @@ private:
void initializeModeSignals(EffectLabel &label);
std::unique_ptr<QMenu> createMainMenu();
std::unique_ptr<QMenu> createChatModeMenu();
/**
* @brief Reset the thumbnail data and timer so a new
* thumbnail can be fetched
**/
void resetThumbnail();
void handleChannelChanged();
Split *const split_{};