mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Fix crash in custom duration status set.
This commit is contained in:
parent
edb011dc0d
commit
bc90399ec3
2 changed files with 5 additions and 11 deletions
|
@ -62,10 +62,6 @@ void EmojiStatusPanel::setChooseFilter(Fn<bool(DocumentId)> filter) {
|
|||
_chooseFilter = std::move(filter);
|
||||
}
|
||||
|
||||
void EmojiStatusPanel::setChooseCallback(Fn<void(DocumentId)> callback) {
|
||||
_chooseCallback = std::move(callback);
|
||||
}
|
||||
|
||||
void EmojiStatusPanel::show(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<QWidget*> button,
|
||||
|
@ -173,16 +169,16 @@ void EmojiStatusPanel::create(
|
|||
return Chosen{ .animation = data.messageSendingFrom };
|
||||
});
|
||||
|
||||
const auto weak = Ui::MakeWeak(_panel.get());
|
||||
const auto accept = [=](Chosen chosen) {
|
||||
Expects(chosen.until != Selector::kPickCustomTimeId);
|
||||
|
||||
// From PickUntilBox is called after EmojiStatusPanel is destroyed!
|
||||
const auto owner = &controller->session().data();
|
||||
startAnimation(owner, body, chosen.id, chosen.animation);
|
||||
if (_chooseCallback) {
|
||||
_chooseCallback(chosen.id);
|
||||
} else {
|
||||
owner->emojiStatuses().set(chosen.id, chosen.until);
|
||||
if (weak) {
|
||||
startAnimation(owner, body, chosen.id, chosen.animation);
|
||||
}
|
||||
owner->emojiStatuses().set(chosen.id, chosen.until);
|
||||
};
|
||||
|
||||
rpl::merge(
|
||||
|
|
|
@ -41,7 +41,6 @@ public:
|
|||
~EmojiStatusPanel();
|
||||
|
||||
void setChooseFilter(Fn<bool(DocumentId)> filter);
|
||||
void setChooseCallback(Fn<void(DocumentId)> callback);
|
||||
|
||||
void show(
|
||||
not_null<Window::SessionController*> controller,
|
||||
|
@ -64,7 +63,6 @@ private:
|
|||
|
||||
base::unique_qptr<ChatHelpers::TabbedPanel> _panel;
|
||||
Fn<bool(DocumentId)> _chooseFilter;
|
||||
Fn<void(DocumentId)> _chooseCallback;
|
||||
QPointer<QWidget> _panelButton;
|
||||
std::unique_ptr<Ui::EmojiFlyAnimation> _animation;
|
||||
Data::CustomEmojiSizeTag _animationSizeTag = {};
|
||||
|
|
Loading…
Add table
Reference in a new issue