Bots: Fix opening webapps and games (#2377)

This commit is contained in:
Alexander Zinchuk 2023-01-28 02:16:03 +01:00
parent 564acf2315
commit d03755ded0

View File

@ -575,10 +575,6 @@ addActionHandler('markBotTrusted', (global, actions, payload): ActionReturnType
trustedBotIds: Array.from(newTrustedBotIds),
};
global = updateTabState(global, {
botTrustRequest: undefined,
}, tabId);
const tabState = selectTabState(global, tabId);
if (tabState.botTrustRequest?.onConfirm) {
const { action, payload: callbackPayload } = tabState.botTrustRequest.onConfirm;
@ -586,6 +582,10 @@ addActionHandler('markBotTrusted', (global, actions, payload): ActionReturnType
actions[action](callbackPayload);
}
global = updateTabState(global, {
botTrustRequest: undefined,
}, tabId);
setGlobal(global);
});