react-native-okhi 2.0.19 → 2.0.21

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.
@@ -73,7 +73,7 @@ repositories {
73
73
  def kotlin_version = getExtOrDefault("kotlinVersion")
74
74
 
75
75
  dependencies {
76
- implementation 'io.okhi.android:okhi:1.0.13'
76
+ implementation 'io.okhi.android:okhi:1.0.15'
77
77
  implementation "com.facebook.react:react-android"
78
78
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
79
79
  }
@@ -22,27 +22,33 @@ class OkhiModule(reactContext: ReactApplicationContext) : NativeOkhiSpec(reactCo
22
22
 
23
23
  val okhiAddressVerificationCallback = object : OkHiAddressVerificationCallback() {
24
24
  override fun onClose() {
25
+ val cb = currentCallback
26
+ currentCallback = null
25
27
  val error = Arguments.createMap().apply {
26
28
  putString("code", "user_closed")
27
29
  putString("message", "user closed address creation")
28
30
  }
29
- currentCallback?.invoke(null, error)
31
+ cb?.invoke(null, error)
30
32
  }
31
33
 
32
34
  override fun onError(e: OkHiException) {
35
+ val cb = currentCallback
36
+ currentCallback = null
33
37
  val error = Arguments.createMap().apply {
34
38
  putString("code", e.code)
35
39
  putString("message", e.message)
36
40
  }
37
- currentCallback?.invoke(null, error)
41
+ cb?.invoke(null, error)
38
42
  }
39
43
 
40
44
  override fun onSuccess(response: OkHiSuccessResponse) {
41
- val response = Arguments.createMap().apply {
45
+ val cb = currentCallback
46
+ currentCallback = null
47
+ val responseMap = Arguments.createMap().apply {
42
48
  putString("user", response.user.toJSON().toString())
43
49
  putString("location", response.location.toJSON().toString())
44
50
  }
45
- currentCallback?.invoke(response, null)
51
+ cb?.invoke(responseMap, null)
46
52
  }
47
53
  }
48
54
 
@@ -194,7 +200,7 @@ class OkhiModule(reactContext: ReactApplicationContext) : NativeOkhiSpec(reactCo
194
200
  } else {
195
201
  val styleMap = okcollect.getMap("style")
196
202
  val color = styleMap?.getString("color") ?: "#005D67"
197
- val logo = styleMap?.getString("color") ?: "https://cdn.okhi.co/icon.png"
203
+ val logo = styleMap?.getString("logo") ?: "https://cdn.okhi.co/icon.png"
198
204
 
199
205
  val configurationMap = okcollect.getMap("configuration")
200
206
  val streetView = configurationMap?.getBoolean("streetView") ?: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-okhi",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "description": "The OkHi React Native library enables you to collect and verify addresses from your users",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/OkHi/react-native-okhi",