Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

paymentRequestWithCardForm returns promise before modal fully disappeared #556

Closed
andrzejbe opened this issue Sep 24, 2019 · 0 comments
Closed
Labels

Comments

@andrzejbe
Copy link

Before I have submitted the issue

[x] I have read an installation guide
[x] I know that for an iOS I need to install pods because I've read the installation guide
[x] I have read a linking guide and checked that everything is OK like in manual linking guide
[x] I know that before using tipsi-stripe I need to set options for my app as described in usage guide

The problem

On iOS, when paymentRequestWithCardForm() is called and returns a promise upon filling the form, the Promise is being returned before the Modal actually fully disappears. As a side-effect to this, due to popular bug in react-native is it then impossible to open another RN Modal right after paymentRequestWithCardForm is resolved.

e.g.

paymentRequestWithCardForm().then(data => openMyModal())

^^ if openMyModal would trigger opening new Modal, such modal will never gets displayed because its being opened while paymentRequestWithCardForm modal is still being closed (animation still hasn't finished).

Ideally, paymentRequestWithCardForm() should return promise only when its modal is fully closed (animation has finished) = equivalent to RN Modal onDismiss()

Currently the only somewhat dirty workaround is to manually delay opening new modal e.g. something like this:

paymentRequestWithCardForm().then(data => setTimeout(function() { openMyModal(); )}.bind(this), 250)

.. but its not ideal ;)

Environment

  • tipsi-stripe version: 8.0.0-beta.8
  • Last tipsi-stripe version where the issue was not reproduced (if applicable): no idea
  • iOS or Android: only IOS
  • OS version: iOS 13
  • React-Native version: 0.60.3
  • (Android only) com.google.firebase:firebase-core version: n/a
  • (Android only) com.google.android.gms:play-services-base version: n/a

Links to logs and sources

from Xcode logs:

2019-09-24 21:08:55.037926+0200 nativeapp[39073:1658965] Warning: Attempt to present <RCTModalHostViewController: 0x7fa152d46850> on <UIViewController: 0x7fa14cf02280> while a presentation is in progress!

See also: facebook/react-native#10471

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants