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

Fix playing music from a different account.

This commit is contained in:
John Preston
2020-06-25 15:12:50 +04:00
parent c60b9cfa4d
commit 90a9cb4f8d
6 changed files with 59 additions and 27 deletions

View File

@@ -251,11 +251,6 @@ MainWidget::MainWidget(
connect(_dialogs, SIGNAL(cancelled()), this, SLOT(dialogsCancelled()));
connect(_history, &HistoryWidget::cancelled, [=] { handleHistoryBack(); });
Media::Player::instance()->updatedNotifier(
) | rpl::start_with_next([=](const Media::Player::TrackState &state) {
handleAudioUpdate(state);
}, lifetime());
subscribe(session().calls().currentCallChanged(), [=](Calls::Call *call) {
setCurrentCall(call);
});
@@ -268,6 +263,16 @@ MainWidget::MainWidget(
_exportTopBar->finishAnimating();
}
Media::Player::instance()->updatedNotifier(
) | rpl::start_with_next([=](const Media::Player::TrackState &state) {
handleAudioUpdate(state);
}, lifetime());
handleAudioUpdate(Media::Player::instance()->getState(AudioMsgId::Type::Song));
handleAudioUpdate(Media::Player::instance()->getState(AudioMsgId::Type::Voice));
if (_player) {
_player->finishAnimating();
}
subscribe(_controller->dialogsListFocused(), [this](bool) {
updateDialogsWidthAnimated();
});