Fix crash in "Copy Topic Link" action.
This commit is contained in:
@@ -1074,12 +1074,15 @@ void Filler::addTopicLink() {
|
||||
return;
|
||||
}
|
||||
const auto controller = _controller;
|
||||
const auto weak = base::make_weak(_topic);
|
||||
_addAction(tr::lng_context_copy_topic_link(tr::now), [=] {
|
||||
const auto link = Info::Profile::TopicLink(_topic, true);
|
||||
QGuiApplication::clipboard()->setText(link);
|
||||
controller->showToast(channel->hasUsername()
|
||||
? tr::lng_channel_public_link_copied(tr::now)
|
||||
: tr::lng_context_about_private_link(tr::now));
|
||||
if (const auto strong = weak.get()) {
|
||||
const auto link = Info::Profile::TopicLink(strong, true);
|
||||
QGuiApplication::clipboard()->setText(link);
|
||||
controller->showToast(channel->hasUsername()
|
||||
? tr::lng_channel_public_link_copied(tr::now)
|
||||
: tr::lng_context_about_private_link(tr::now));
|
||||
}
|
||||
}, &st::menuIconCopy);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user