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:
@@ -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
|
||||
|
Reference in New Issue
Block a user