Saved Gifts: Update saved gifts after upgrade gift (#6259)
This commit is contained in:
parent
1d4db8f131
commit
0d6388b3d9
@ -1002,7 +1002,7 @@ addActionHandler('launchPrepaidStarsGiveaway', async (global, actions, payload):
|
||||
actions.openBoostStatistics({ chatId, tabId });
|
||||
});
|
||||
|
||||
addActionHandler('upgradeGift', (global, actions, payload): ActionReturnType => {
|
||||
addActionHandler('upgradeGift', async (global, actions, payload): Promise<void> => {
|
||||
const {
|
||||
gift, shouldKeepOriginalDetails, upgradeStars, tabId = getCurrentTabId(),
|
||||
} = payload;
|
||||
@ -1023,11 +1023,16 @@ addActionHandler('upgradeGift', (global, actions, payload): ActionReturnType =>
|
||||
actions.closeGiftInfoModal({ tabId });
|
||||
|
||||
if (!upgradeStars) {
|
||||
callApi('upgradeStarGift', {
|
||||
const result = await callApi('upgradeStarGift', {
|
||||
inputSavedGift: requestSavedGift,
|
||||
shouldKeepOriginalDetails: shouldKeepOriginalDetails || undefined,
|
||||
});
|
||||
|
||||
global = getGlobal();
|
||||
if (result && global.currentUserId) {
|
||||
actions.reloadPeerSavedGifts({ peerId: global.currentUserId });
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -170,6 +170,10 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => {
|
||||
}
|
||||
}
|
||||
|
||||
if (inputInvoice?.type === 'stargiftUpgrade' && global.currentUserId) {
|
||||
actions.reloadPeerSavedGifts({ peerId: global.currentUserId });
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user