2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix album part edit/delete/replace after reorder.

This commit is contained in:
John Preston
2023-08-16 13:23:06 +02:00
parent f502229cc8
commit b5d3391956
3 changed files with 10 additions and 17 deletions

View File

@@ -760,6 +760,8 @@ void SendFilesBox::pushBlock(int from, int till) {
) | rpl::filter([=] {
return !_removingIndex;
}) | rpl::start_with_next([=](int index) {
applyBlockChanges();
_removingIndex = index;
crl::on_main(this, [=] {
const auto index = base::take(_removingIndex).value_or(-1);
@@ -780,6 +782,8 @@ void SendFilesBox::pushBlock(int from, int till) {
const auto show = uiShow();
block.itemReplaceRequest(
) | rpl::start_with_next([=](int index) {
applyBlockChanges();
const auto replace = [=](Ui::PreparedList list) {
if (list.files.empty()) {
return;
@@ -855,6 +859,8 @@ void SendFilesBox::pushBlock(int from, int till) {
const auto openedOnce = widget->lifetime().make_state<bool>(false);
block.itemModifyRequest(
) | rpl::start_with_next([=, show = _show](int index) {
applyBlockChanges();
if (!(*openedOnce)) {
show->session().settings().incrementPhotoEditorHintShown();
show->session().saveSettings();