Browse Source

Fix closing payment popup

master
Eduard Kuzmenko 2 years ago
parent
commit
4daa3dd321
  1. 4
      .env
  2. 12
      src/components/popups/payment.ts

4
.env

@ -1,5 +1,5 @@
API_ID=1025907 API_ID=1025907
API_HASH=452b0359b988148995f22ff0f4229750 API_HASH=452b0359b988148995f22ff0f4229750
VERSION=1.5.0 VERSION=1.5.0
VERSION_FULL=1.5.0 (198) VERSION_FULL=1.5.0 (199)
BUILD=198 BUILD=199

12
src/components/popups/payment.ts

@ -761,6 +761,13 @@ export default class PopupPayment extends PopupElement {
onConfirmed(); onConfirmed();
} else { } else {
popupPaymentVerification = new PopupPaymentVerification(paymentResult.url); popupPaymentVerification = new PopupPaymentVerification(paymentResult.url);
popupPaymentVerification.addEventListener('finish', () => {
popupPaymentVerification = undefined;
// setTimeout(() => {
onConfirmed();
// }, 0);
});
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
popupPaymentVerification.addEventListener('close', () => { popupPaymentVerification.addEventListener('close', () => {
popupPaymentVerification = undefined; popupPaymentVerification = undefined;
@ -773,11 +780,6 @@ export default class PopupPayment extends PopupElement {
} }
}); });
}); });
popupPaymentVerification.addEventListener('finish', () => {
popupPaymentVerification = undefined;
onConfirmed();
});
} }
} catch(err) { } catch(err) {
if((err as ApiError).type === 'BOT_PRECHECKOUT_TIMEOUT') { if((err as ApiError).type === 'BOT_PRECHECKOUT_TIMEOUT') {

Loading…
Cancel
Save