Mini Apps: Fix check for bot trust (#4835)
This commit is contained in:
parent
1e87870302
commit
23b6e5e66d
@ -639,7 +639,7 @@ addActionHandler('requestAppWebView', async (global, actions, payload): Promise<
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (botApp.isInactive && !selectIsTrustedBot(global, botId)) {
|
if (botApp.isInactive || !selectIsTrustedBot(global, botId)) {
|
||||||
global = updateTabState(global, {
|
global = updateTabState(global, {
|
||||||
botTrustRequest: {
|
botTrustRequest: {
|
||||||
botId,
|
botId,
|
||||||
|
|||||||
@ -87,8 +87,7 @@ export function selectChatOnlineCount<T extends GlobalState>(global: T, chat: Ap
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function selectIsTrustedBot<T extends GlobalState>(global: T, botId: string) {
|
export function selectIsTrustedBot<T extends GlobalState>(global: T, botId: string) {
|
||||||
const bot = selectUser(global, botId);
|
return global.trustedBotIds.includes(botId);
|
||||||
return bot && (bot.isVerified || global.trustedBotIds.includes(botId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function selectChatType<T extends GlobalState>(global: T, chatId: string) : ApiChatType | undefined {
|
export function selectChatType<T extends GlobalState>(global: T, chatId: string) : ApiChatType | undefined {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user