Attempt to fix possible crash in quick action.

This commit is contained in:
John Preston
2025-11-07 15:37:17 +04:00
parent b0726cd31a
commit 5faefa7997
@@ -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<Ui::RippleAnimation>(
st::defaultRippleAnimation,
Ui::RippleAnimation::RectMask(size),
isRemovingFromList
? Fn<void()>([=] { update(); })
: updateCallback);
updateCallback);
}
if (!context->rippleFg) {
context->rippleFg = std::make_unique<Ui::RippleAnimation>(
@@ -2147,13 +2144,11 @@ bool InnerWidget::addQuickActionRipple(
Rect(size),
context->icon.get(),
ResolveQuickDialogLabel(
row->history(),
history,
action,
_filterId));
}),
isRemovingFromList
? Fn<void()>([=] { 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));