mirror of https://github.com/procxx/kepka.git
Fix mediaview update when image is loaded.
Subscribe on app launch, not only when AuthSession has changed.
This commit is contained in:
parent
ee45bbe4c6
commit
e4f7b3c7c2
|
@ -90,15 +90,20 @@ MediaView::MediaView(QWidget*) : TWidget(nullptr)
|
||||||
connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(onScreenResized(int)));
|
connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(onScreenResized(int)));
|
||||||
|
|
||||||
// While we have one mediaview for all authsessions we have to do this.
|
// While we have one mediaview for all authsessions we have to do this.
|
||||||
subscribe(Messenger::Instance().authSessionChanged(), [this] {
|
auto subscribeToDownloadFinished = [this] {
|
||||||
if (!AuthSession::Exists()) return;
|
if (AuthSession::Exists()) {
|
||||||
|
|
||||||
subscribe(AuthSession::CurrentDownloaderTaskFinished(), [this] {
|
subscribe(AuthSession::CurrentDownloaderTaskFinished(), [this] {
|
||||||
if (!isHidden()) {
|
if (!isHidden()) {
|
||||||
updateControls();
|
updateControls();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
subscribe(Messenger::Instance().authSessionChanged(), [this, subscribeToDownloadFinished] {
|
||||||
|
subscribeToDownloadFinished();
|
||||||
});
|
});
|
||||||
|
subscribeToDownloadFinished();
|
||||||
|
|
||||||
auto observeEvents = Notify::PeerUpdate::Flag::SharedMediaChanged;
|
auto observeEvents = Notify::PeerUpdate::Flag::SharedMediaChanged;
|
||||||
subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(observeEvents, [this](const Notify::PeerUpdate &update) {
|
subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(observeEvents, [this](const Notify::PeerUpdate &update) {
|
||||||
mediaOverviewUpdated(update);
|
mediaOverviewUpdated(update);
|
||||||
|
|
Loading…
Reference in New Issue