mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix attach menu suggested bot launch.
This commit is contained in:
parent
4955cdcdce
commit
3da44eb5dd
1 changed files with 13 additions and 0 deletions
|
@ -828,6 +828,19 @@ void AttachWebView::requestWithOptionalConfirm(
|
|||
void AttachWebView::request(const WebViewButton &button) {
|
||||
Expects(_context != nullptr && _bot != nullptr);
|
||||
|
||||
if (button.fromAttachMenu) {
|
||||
const auto bot = ranges::find(
|
||||
_attachBots,
|
||||
not_null{ _bot },
|
||||
&AttachWebViewBot::user);
|
||||
if (bot == end(_attachBots) || bot->inactive) {
|
||||
requestAddToMenu(_bot, AddToMenuOpenAttach{
|
||||
.startCommand = button.startCommand,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_startCommand = button.startCommand;
|
||||
const auto &action = _context->action;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue