Bot Button: Fix opening web app (#2320)
This commit is contained in:
parent
661b2b62e0
commit
89db13f7c8
@ -786,12 +786,10 @@ const Composer: FC<OwnProps & StateProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
const attachBot = attachBots[chatId];
|
||||
|
||||
callAttachBot({
|
||||
bot: attachBot, chatId, isFromBotMenu: true, url: botMenuButton.url, threadId,
|
||||
chatId, url: botMenuButton.url, threadId,
|
||||
});
|
||||
}, [attachBots, botMenuButton, callAttachBot, chatId, threadId]);
|
||||
}, [botMenuButton, callAttachBot, chatId, threadId]);
|
||||
|
||||
const handleActivateBotCommandMenu = useCallback(() => {
|
||||
closeSymbolMenu();
|
||||
|
||||
@ -592,8 +592,9 @@ async function loadAttachBots(hash?: string) {
|
||||
|
||||
addActionHandler('callAttachBot', (global, actions, payload) => {
|
||||
const {
|
||||
chatId, bot, isFromBotMenu, url, startParam, threadId,
|
||||
chatId, bot, url, startParam, threadId,
|
||||
} = payload;
|
||||
const isFromBotMenu = !bot;
|
||||
if (!isFromBotMenu && !global.attachMenu.bots[bot.id]) {
|
||||
return {
|
||||
...global,
|
||||
@ -611,7 +612,7 @@ addActionHandler('callAttachBot', (global, actions, payload) => {
|
||||
actions.requestWebView({
|
||||
url,
|
||||
peerId: chatId,
|
||||
botId: bot.id,
|
||||
botId: isFromBotMenu ? chatId : bot.id,
|
||||
theme,
|
||||
buttonText: '',
|
||||
isFromBotMenu,
|
||||
|
||||
@ -1178,8 +1178,7 @@ export interface ActionPayloads {
|
||||
callAttachBot: {
|
||||
chatId: string;
|
||||
threadId?: number;
|
||||
bot: ApiAttachBot;
|
||||
isFromBotMenu?: boolean;
|
||||
bot?: ApiAttachBot;
|
||||
url?: string;
|
||||
startParam?: string;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user