From 5faefa7997478532ea9e98018a777f21e31e5e60 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 7 Nov 2025 15:37:17 +0400 Subject: [PATCH] Attempt to fix possible crash in quick action. --- .../SourceFiles/dialogs/dialogs_inner_widget.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index ef857fc43e..4926a27929 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -2113,6 +2113,7 @@ bool InnerWidget::addQuickActionRipple( } auto name = ResolveQuickDialogLottieIconName(type); + const auto rowHeight = row->height(); context->icon = Lottie::MakeIcon({ .name = std::move(name), .sizeOverride = Size(st::dialogsQuickActionSize), @@ -2121,16 +2122,12 @@ bool InnerWidget::addQuickActionRipple( context->icon->jumpTo(context->icon->framesCount() - 1, [=] { const auto size = QSize( st::dialogsQuickActionRippleSize, - row->height()); - const auto isRemovingFromList - = (action == Dialogs::Ui::QuickDialogAction::Archive); + rowHeight); if (!context->ripple) { context->ripple = std::make_unique( st::defaultRippleAnimation, Ui::RippleAnimation::RectMask(size), - isRemovingFromList - ? Fn([=] { update(); }) - : updateCallback); + updateCallback); } if (!context->rippleFg) { context->rippleFg = std::make_unique( @@ -2147,13 +2144,11 @@ bool InnerWidget::addQuickActionRipple( Rect(size), context->icon.get(), ResolveQuickDialogLabel( - row->history(), + history, action, _filterId)); }), - isRemovingFromList - ? Fn([=] { update(); }) - : std::move(updateCallback)); + std::move(updateCallback)); } context->ripple->add(QPoint(size.width() / 2, size.height() / 2)); context->rippleFg->add(QPoint(size.width() / 2, size.height() / 2));