Close PiP if message with video gets deleted.
This commit is contained in:
parent
0ce01410a1
commit
cabed9587b
|
@ -254,6 +254,7 @@ struct OverlayWidget::PipWrap {
|
||||||
|
|
||||||
PipDelegate delegate;
|
PipDelegate delegate;
|
||||||
Pip wrapped;
|
Pip wrapped;
|
||||||
|
rpl::lifetime lifetime;
|
||||||
};
|
};
|
||||||
|
|
||||||
OverlayWidget::Streamed::Streamed(
|
OverlayWidget::Streamed::Streamed(
|
||||||
|
@ -3352,6 +3353,16 @@ void OverlayWidget::switchToPip() {
|
||||||
_streamed->instance.shared(),
|
_streamed->instance.shared(),
|
||||||
closeAndContinue,
|
closeAndContinue,
|
||||||
[=] { _pip = nullptr; });
|
[=] { _pip = nullptr; });
|
||||||
|
|
||||||
|
if (const auto raw = _message) {
|
||||||
|
raw->history()->owner().itemRemoved(
|
||||||
|
) | rpl::filter([=](not_null<const HistoryItem*> item) {
|
||||||
|
return (raw == item);
|
||||||
|
}) | rpl::start_with_next([=] {
|
||||||
|
_pip = nullptr;
|
||||||
|
}, _pip->lifetime);
|
||||||
|
}
|
||||||
|
|
||||||
if (isHidden()) {
|
if (isHidden()) {
|
||||||
clearBeforeHide();
|
clearBeforeHide();
|
||||||
clearAfterHide();
|
clearAfterHide();
|
||||||
|
|
Loading…
Reference in New Issue