mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Close PiP if message with video gets deleted.
This commit is contained in:
parent
0ce01410a1
commit
cabed9587b
1 changed files with 11 additions and 0 deletions
|
@ -254,6 +254,7 @@ struct OverlayWidget::PipWrap {
|
|||
|
||||
PipDelegate delegate;
|
||||
Pip wrapped;
|
||||
rpl::lifetime lifetime;
|
||||
};
|
||||
|
||||
OverlayWidget::Streamed::Streamed(
|
||||
|
@ -3352,6 +3353,16 @@ void OverlayWidget::switchToPip() {
|
|||
_streamed->instance.shared(),
|
||||
closeAndContinue,
|
||||
[=] { _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()) {
|
||||
clearBeforeHide();
|
||||
clearAfterHide();
|
||||
|
|
Loading…
Add table
Reference in a new issue