Skip to content

Commit 56a07d2

Browse files
committed
Gifts: freeze confirm button during upgrade
1 parent 3ff28d7 commit 56a07d2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/components/popups/starGiftUpgrade.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {STARS_CURRENCY} from '../../lib/mtproto/mtproto_config';
1818
import {attachClickEvent} from '../../helpers/dom/clickEvent';
1919
import PopupPayment from './payment';
2020
import wrapPeerTitle from '../wrappers/peerTitle';
21+
import toggleDisability from '../../helpers/dom/toggleDisability';
2122

2223
export default class PopupStarGiftUpgrade extends PopupElement {
2324
private constructor(
@@ -54,23 +55,28 @@ export default class PopupStarGiftUpgrade extends PopupElement {
5455
if(this.descriptionForPeerId) {
5556
this.hide();
5657
} else if(freeUpgrade) {
58+
const toggle = toggleDisability(this.btnConfirm, true);
5759
this.managers.appGiftsManager.upgradeStarGift(
5860
this.gift.input,
5961
keepInfoSignal[0]()
60-
).then(() => this.hide());
62+
).then(() => this.hide(), toggle);
6163
} else {
64+
const toggle = toggleDisability(this.btnConfirm, true);
6265
PopupPayment.create({
6366
inputInvoice: {
6467
_: 'inputInvoiceStarGiftUpgrade',
6568
stargift: this.gift.input,
6669
pFlags: {
6770
keep_original_details: keepInfoSignal[0]() ? true : undefined
6871
}
69-
}
72+
},
73+
noShowIfStars: true
7074
}).then((popup) => {
7175
popup.addEventListener('finish', (result) => {
7276
if(result === 'paid') {
7377
this.hide();
78+
} else {
79+
toggle();
7480
}
7581
});
7682
});

0 commit comments

Comments
 (0)