2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Removed Ui::show from classes that have pointer to Controller.

This commit is contained in:
23rd
2021-06-13 10:37:52 +03:00
committed by John Preston
parent c8535acad8
commit b422ec025e
46 changed files with 296 additions and 193 deletions

View File

@@ -34,7 +34,11 @@ void CheckChatInvite(
session->api().checkChatInvite(hash, [=](const MTPChatInvite &result) {
Core::App().hideMediaView();
result.match([=](const MTPDchatInvite &data) {
const auto box = Ui::show(Box<ConfirmInviteBox>(
const auto strongController = weak.get();
if (!strongController) {
return;
}
const auto box = strongController->show(Box<ConfirmInviteBox>(
session,
data,
invitePeekChannel,
@@ -80,7 +84,10 @@ void CheckChatInvite(
return;
}
Core::App().hideMediaView();
Ui::show(Box<InformBox>(tr::lng_group_invite_bad_link(tr::now)));
if (const auto strong = weak.get()) {
strong->show(
Box<InformBox>(tr::lng_group_invite_bad_link(tr::now)));
}
});
}