mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Added handling of deleting currently edited scheduled text messages.
This commit is contained in:
parent
0a4f3f310c
commit
4b01043b27
1 changed files with 19 additions and 1 deletions
|
@ -346,7 +346,7 @@ void ComposeControls::init() {
|
||||||
}, _wrap->lifetime());
|
}, _wrap->lifetime());
|
||||||
|
|
||||||
_header->editMsgId(
|
_header->editMsgId(
|
||||||
) | rpl::start_with_next([=](auto id) {
|
) | rpl::start_with_next([=](const auto &id) {
|
||||||
updateHeight();
|
updateHeight();
|
||||||
updateSendButtonType();
|
updateSendButtonType();
|
||||||
|
|
||||||
|
@ -357,6 +357,24 @@ void ComposeControls::init() {
|
||||||
_localSavedText = {};
|
_localSavedText = {};
|
||||||
}
|
}
|
||||||
}, _wrap->lifetime());
|
}, _wrap->lifetime());
|
||||||
|
|
||||||
|
{
|
||||||
|
const auto lastMsgId = _wrap->lifetime().make_state<FullMsgId>();
|
||||||
|
|
||||||
|
_header->editMsgId(
|
||||||
|
) | rpl::filter([=](const auto &id) {
|
||||||
|
return !!id;
|
||||||
|
}) | rpl::start_with_next([=](const auto &id) {
|
||||||
|
*lastMsgId = id;
|
||||||
|
}, _wrap->lifetime());
|
||||||
|
|
||||||
|
_window->session().data().itemRemoved(
|
||||||
|
) | rpl::filter([=](not_null<const HistoryItem*> item) {
|
||||||
|
return item->id && ((*lastMsgId) == item->fullId());
|
||||||
|
}) | rpl::start_with_next([=] {
|
||||||
|
cancelEditMessage();
|
||||||
|
}, _wrap->lifetime());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposeControls::setTextFromEditingMessage(not_null<HistoryItem*> item) {
|
void ComposeControls::setTextFromEditingMessage(not_null<HistoryItem*> item) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue