mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix: accidental crash
This commit is contained in:
parent
2f069bcd02
commit
50bc6a33f6
1 changed files with 23 additions and 14 deletions
|
@ -216,9 +216,12 @@ ActionStickerPackAuthor::ActionStickerPackAuthor(not_null<Menu::Menu *> menu,
|
||||||
not_null<Main::Session *> session,
|
not_null<Main::Session *> session,
|
||||||
ID authorId)
|
ID authorId)
|
||||||
: ActionWithSubText(menu, menu->st(), st::menuIconStickers, [=]
|
: ActionWithSubText(menu, menu->st(), st::menuIconStickers, [=]
|
||||||
{ }, tr::ayu_MessageDetailsPackOwnerPC(tr::now), tr::ayu_MessageDetailsPackOwnerFetchingPC(tr::now)),
|
{ }, tr::ayu_MessageDetailsPackOwnerPC(tr::now), QString()),
|
||||||
_session(session)
|
_session(session)
|
||||||
{
|
{
|
||||||
|
const auto fetchingText = tr::ayu_MessageDetailsPackOwnerFetchingPC(tr::now);
|
||||||
|
_subText = QString(fetchingText);
|
||||||
|
|
||||||
searchAuthor(authorId);
|
searchAuthor(authorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,16 +230,21 @@ void ActionStickerPackAuthor::searchAuthor(ID authorId)
|
||||||
searchById(authorId, _session, [=](const QString &username, UserData *user)
|
searchById(authorId, _session, [=](const QString &username, UserData *user)
|
||||||
{
|
{
|
||||||
if (username.isEmpty() && !user) {
|
if (username.isEmpty() && !user) {
|
||||||
_subText = tr::ayu_MessageDetailsPackOwnerNotFoundPC(tr::now);
|
const auto notFoundText = tr::ayu_MessageDetailsPackOwnerNotFoundPC(tr::now);
|
||||||
setClickedCallback([=] {
|
_subText = QString(notFoundText);
|
||||||
const auto text = QString("int32: %1\nint64: %2").arg(authorId).arg(0x100000000L + authorId);
|
setClickedCallback(
|
||||||
QGuiApplication::clipboard()->setText(text);
|
[=]
|
||||||
});
|
{
|
||||||
|
const auto text =
|
||||||
|
QString("int32: %1\nint64: %2").arg(authorId).arg(0x100000000L + authorId);
|
||||||
|
QGuiApplication::clipboard()->setText(text);
|
||||||
|
});
|
||||||
|
|
||||||
crl::on_main([=]
|
crl::on_main(
|
||||||
{
|
[=]
|
||||||
update();
|
{
|
||||||
});
|
update();
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,10 +266,11 @@ void ActionStickerPackAuthor::searchAuthor(ID authorId)
|
||||||
setClickedCallback(callback);
|
setClickedCallback(callback);
|
||||||
|
|
||||||
_subText = title;
|
_subText = title;
|
||||||
crl::on_main([=]
|
crl::on_main(
|
||||||
{
|
[=]
|
||||||
update();
|
{
|
||||||
});
|
update();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue