mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix channel creation flow.
This commit is contained in:
parent
3573b84e8b
commit
91e6c42fcf
1 changed files with 14 additions and 7 deletions
|
@ -140,6 +140,19 @@ void MustBePublicFailed(
|
||||||
MustBePublicDestroy(channel);
|
MustBePublicDestroy(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] Fn<void(not_null<PeerData*>)> WrapPeerDoneFromChannelDone(
|
||||||
|
Fn<void(not_null<ChannelData*>)> channelDone) {
|
||||||
|
if (!channelDone) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return [=](not_null<PeerData*> peer) {
|
||||||
|
if (const auto channel = peer->asChannel()) {
|
||||||
|
const auto onstack = channelDone;
|
||||||
|
onstack(channel);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TextWithEntities PeerFloodErrorText(
|
TextWithEntities PeerFloodErrorText(
|
||||||
|
@ -482,13 +495,7 @@ GroupInfoBox::GroupInfoBox(
|
||||||
, _api(&_navigation->session().mtp())
|
, _api(&_navigation->session().mtp())
|
||||||
, _type(type)
|
, _type(type)
|
||||||
, _initialTitle(title)
|
, _initialTitle(title)
|
||||||
, _done([channelDone = std::move(channelDone)](not_null<PeerData*> peer) {
|
, _done(WrapPeerDoneFromChannelDone(std::move(channelDone))) {
|
||||||
if (const auto channel = peer->asChannel()) {
|
|
||||||
if (const auto onstack = channelDone) {
|
|
||||||
onstack(channel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupInfoBox::GroupInfoBox(
|
GroupInfoBox::GroupInfoBox(
|
||||||
|
|
Loading…
Add table
Reference in a new issue