MiddleSearch and Payments: Fix attempt to set an outdated global (#5073)

This commit is contained in:
Alexander Zinchuk 2024-10-20 18:53:51 +02:00
parent 09ddb6483f
commit 66ec9f5732
2 changed files with 7 additions and 2 deletions

View File

@ -228,6 +228,7 @@ addActionHandler('searchChatMediaMessages', (global, actions, payload): ActionRe
if (!currentSearch) {
return;
}
global = getGlobal();
}
void searchChatMedia(global,

View File

@ -472,6 +472,8 @@ addActionHandler('openGiveawayModal', async (global, actions, payload): Promise<
return;
}
global = getGlobal();
const isOpen = Boolean(chatId);
global = updateTabState(global, {
@ -563,10 +565,10 @@ addActionHandler('openPremiumGiftModal', async (global, actions, payload): Promi
const result = await callApi('fetchPremiumPromo');
if (!result) return;
global = getGlobal();
const gifts = await callApi('getPremiumGiftCodeOptions', {});
global = getGlobal();
global = updateTabState(global, {
giftModal: {
isOpen: true,
@ -593,6 +595,8 @@ addActionHandler('openStarsGiftModal', async (global, actions, payload): Promise
const starsGiftOptions = await callApi('getStarsGiftOptions', {});
global = getGlobal();
global = updateTabState(global, {
starsGiftModal: {
isOpen: true,