Fix crash in toasts.
This commit is contained in:
parent
04e6428fec
commit
a755fa391e
1 changed files with 6 additions and 4 deletions
|
|
@ -40,10 +40,12 @@ Widget::Widget(QWidget *parent, const Config &config)
|
|||
_multiline ? config.text : TextUtilities::SingleLine(config.text),
|
||||
toastOptions,
|
||||
config.textContext ? config.textContext(this) : std::any());
|
||||
const auto weak = Ui::MakeWeak(this);
|
||||
_text.setSpoilerLinkFilter([=](const ClickContext &context) {
|
||||
return (weak != nullptr);
|
||||
});
|
||||
if (_text.hasSpoilers()) {
|
||||
const auto weak = Ui::MakeWeak(this);
|
||||
_text.setSpoilerLinkFilter([=](const ClickContext &context) {
|
||||
return (weak != nullptr);
|
||||
});
|
||||
}
|
||||
|
||||
_processMouse = _text.hasLinks() || _text.hasSpoilers();
|
||||
if (_processMouse) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue