@expensify/react-native-wallet 0.1.30 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,8 @@ import com.google.android.gms.tapandpay.issuer.PushTokenizeRequest
21
21
  import kotlinx.coroutines.CoroutineScope
22
22
  import kotlinx.coroutines.Dispatchers
23
23
  import kotlinx.coroutines.launch
24
+ import kotlinx.coroutines.SupervisorJob
25
+ import kotlinx.coroutines.cancel
24
26
  import com.expensify.wallet.Utils.getAsyncResult
25
27
  import com.expensify.wallet.Utils.toCardData
26
28
  import com.expensify.wallet.error.InvalidNetworkError
@@ -50,6 +52,7 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
50
52
  private val tapAndPayClient: TapAndPayClient = TapAndPay.getClient(activity)
51
53
  private var pendingCreateWalletPromise: Promise? = null
52
54
  private var pendingPushTokenizePromise: Promise? = null
55
+ private val moduleScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)
53
56
 
54
57
  override fun initialize() {
55
58
  super.initialize()
@@ -58,6 +61,7 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
58
61
 
59
62
  override fun invalidate() {
60
63
  super.invalidate()
64
+ moduleScope.cancel()
61
65
  reactApplicationContext.removeActivityEventListener(cardListener)
62
66
  }
63
67
 
@@ -119,7 +123,7 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
119
123
 
120
124
  @ReactMethod
121
125
  override fun getSecureWalletInfo(promise: Promise) {
122
- CoroutineScope(Dispatchers.Main).launch {
126
+ moduleScope.launch {
123
127
  try {
124
128
  val walletId = getWalletIdAsync()
125
129
  val hardwareId = getHardwareIdAsync()
@@ -51,7 +51,6 @@ class RNAddToWalletButtonView: UIView {
51
51
  let height = bounds.height > 0 ? bounds.height : defaultHeight
52
52
 
53
53
  addPassButton.frame = CGRect(x: 0, y: 0, width: width, height: height)
54
- self.frame = addPassButton.frame
55
54
 
56
55
  applyBorderRadius()
57
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expensify/react-native-wallet",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "A React Native module designed for seamless integration of Card Push Provisioning into Apple Wallet and Google Wallet, enabling easy and secure addition of payment cards directly from your application.",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "lib/commonjs/index",