Check current chat before auto-closing it.

Close current chat only if it is the one being delete-and-exit'ed.
This commit is contained in:
John Preston 2017-11-30 21:35:35 +04:00
parent 2432845df2
commit 43570d1613

View file

@ -110,7 +110,9 @@ auto DeleteAndLeaveHandler(not_null<PeerData*> peer) {
if (!App::main()) return;
Ui::hideLayer();
Ui::showChatsList();
if (App::wnd()->controller()->activePeer.current() == peer) {
Ui::showChatsList();
}
if (peer->isUser()) {
App::main()->deleteConversation(peer);
} else if (auto chat = peer->asChat()) {