2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Fixed several bugs appearing on logout-login in player and messages.

This commit is contained in:
John Preston
2016-10-19 11:59:19 +03:00
parent 48a20f0e71
commit 40fc7379bc
9 changed files with 38 additions and 6 deletions

View File

@@ -59,6 +59,11 @@ Instance::Instance() {
subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(observeEvents, [this](const Notify::PeerUpdate &update) {
notifyPeerUpdated(update);
}));
subscribe(Global::RefSelfChanged(), [this] {
if (!App::self()) {
handleLogout();
}
});
}
void Instance::notifyPeerUpdated(const Notify::PeerUpdate &update) {
@@ -297,5 +302,17 @@ void Instance::preloadNext() {
}
}
void Instance::handleLogout() {
_current = _seeking = AudioMsgId();
_history = nullptr;
_migrated = nullptr;
_repeatEnabled = _isPlaying = false;
_playlist.clear();
_usePanelPlayer.notify(false, true);
}
} // namespace Player
} // namespace Media