mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-20 08:03:45 +08:00
Tear down Layer Info instantly when its sublist dies
Task: 2026/08/21/resubscribe-info-wrap-teardown-on-replaced-sublist
This commit is contained in:
@@ -169,15 +169,19 @@ void WrapWidget::subscribeToThreadDestroyed() {
|
||||
sublist->destroyed(
|
||||
) | rpl::on_next([=] {
|
||||
const auto parent = _controller->parentController();
|
||||
parent->hideSpecialLayer();
|
||||
parent->showBackFromStack(
|
||||
Window::SectionShow(
|
||||
anim::type::instant,
|
||||
anim::activation::background));
|
||||
parent->clearSectionStack(Window::SectionShow(
|
||||
Window::SectionShow::Way::ClearStack,
|
||||
anim::type::instant));
|
||||
_removeRequests.fire({});
|
||||
if (_wrap.current() == Wrap::Layer) {
|
||||
parent->hideSpecialLayer(anim::type::instant);
|
||||
} else if (_wrap.current() == Wrap::Narrow) {
|
||||
parent->showBackFromStack(
|
||||
Window::SectionShow(
|
||||
anim::type::instant,
|
||||
anim::activation::background));
|
||||
parent->clearSectionStack(Window::SectionShow(
|
||||
Window::SectionShow::Way::ClearStack,
|
||||
anim::type::instant));
|
||||
} else {
|
||||
_removeRequests.fire({});
|
||||
}
|
||||
}, _threadDestroyedLifetime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
Info wrap `destroyed()` teardown now rebinds when `showNewContent` replaces the controller, using a wrap-owned lifetime so an old sublist cannot tear down a wrap that no longer shows it. The constructor path still subscribes.
|
||||
Info wrap `destroyed()` teardown now rebinds when `showNewContent` replaces the controller, using a wrap-owned lifetime so an old sublist cannot tear down a wrap that no longer shows it. The constructor path still subscribes. Sublist teardown follows the topic wrap-kind split (Layer hide, Narrow back, else remove) with instant animation so a Layer wrap is gone before the sublist is erased.
|
||||
|
||||
Reference in New Issue
Block a user