From 39a0e69a3b39e5da7af9598a6da5dccacd608e9c Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 18 Oct 2020 12:19:30 +0200 Subject: [PATCH] Reset the timer & refresh thumbnail when changing split channel (#2080) --- CHANGELOG.md | 1 + src/widgets/splits/SplitHeader.cpp | 15 +++++++++++++-- src/widgets/splits/SplitHeader.hpp | 7 +++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adc9606d0..5c398646c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 1348de2fa..4e1df165f 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -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(channel.get())) { this->channelConnections_.emplace_back( - twitchChannel->liveStatusChanged.connect( - [this]() { this->updateChannelText(); })); + twitchChannel->liveStatusChanged.connect([this]() { + this->updateChannelText(); // + })); } } diff --git a/src/widgets/splits/SplitHeader.hpp b/src/widgets/splits/SplitHeader.hpp index d27af3c15..59edcfe1b 100644 --- a/src/widgets/splits/SplitHeader.hpp +++ b/src/widgets/splits/SplitHeader.hpp @@ -48,6 +48,13 @@ private: void initializeModeSignals(EffectLabel &label); std::unique_ptr createMainMenu(); std::unique_ptr createChatModeMenu(); + + /** + * @brief Reset the thumbnail data and timer so a new + * thumbnail can be fetched + **/ + void resetThumbnail(); + void handleChannelChanged(); Split *const split_{};