Mini Apps: Fix check for bot trust (#4835)

This commit is contained in:
zubiden 2024-08-06 20:06:29 +02:00 committed by Alexander Zinchuk
parent 1e87870302
commit 23b6e5e66d
2 changed files with 2 additions and 3 deletions

View File

@ -639,7 +639,7 @@ addActionHandler('requestAppWebView', async (global, actions, payload): Promise<
return;
}
if (botApp.isInactive && !selectIsTrustedBot(global, botId)) {
if (botApp.isInactive || !selectIsTrustedBot(global, botId)) {
global = updateTabState(global, {
botTrustRequest: {
botId,

View File

@ -87,8 +87,7 @@ export function selectChatOnlineCount<T extends GlobalState>(global: T, chat: Ap
}
export function selectIsTrustedBot<T extends GlobalState>(global: T, botId: string) {
const bot = selectUser(global, botId);
return bot && (bot.isVerified || global.trustedBotIds.includes(botId));
return global.trustedBotIds.includes(botId);
}
export function selectChatType<T extends GlobalState>(global: T, chatId: string) : ApiChatType | undefined {