Skip to content

Commit 3291cd2

Browse files
committed
chore: compatibility with RN 0.76 and update deps
1 parent 2b56f1b commit 3291cd2

File tree

6 files changed

+6208
-9248
lines changed

6 files changed

+6208
-9248
lines changed

android/src/main/java/com/mattermost/networkclient/NetworkClient.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,12 @@ internal class NetworkClient(private val context: ReactApplicationContext, priva
376376
requestBody = jsonBody.toString().toRequestBody()
377377
}
378378
ReadableType.Map -> {
379-
val jsonBody = JSONObject(options.getMap("body")!!.toHashMap())
380-
requestBody = jsonBody.toString().toRequestBody()
379+
val jsonBody = (options.getMap("body")!!.toHashMap() as Map<*, *>?)?.let {
380+
JSONObject(
381+
it
382+
)
383+
}
384+
requestBody = jsonBody?.toString()?.toRequestBody()
381385
}
382386
ReadableType.String -> {
383387
requestBody = options.getString("body")!!.toRequestBody()
@@ -443,7 +447,7 @@ internal class NetworkClient(private val context: ReactApplicationContext, priva
443447

444448
private fun setClientHeaders(options: ReadableMap?) {
445449
if (options != null && options.hasKey(("headers"))) {
446-
addClientHeaders(options.getMap("headers")?.toHashMap()?.toWritableMap())
450+
addClientHeaders(options.getMap("headers")?.toWritableMap())
447451
}
448452
}
449453

android/src/newarch/java/com/ApiClientModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ApiClientModule(reactContext: ReactApplicationContext) : NativeApiClientSp
1212
// Keep: Required for RN built in Event Emitter Calls
1313
}
1414

15-
override fun removeListeners(count: Int) {
15+
override fun removeListeners(count: Double) {
1616
// Keep: Required for RN built in Event Emitter Calls
1717
}
1818

android/src/newarch/java/com/WebSocketClientModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class WebSocketClientModule(reactContext: ReactApplicationContext) : Na
1919
// Keep: Required for RN built in Event Emitter Calls
2020
}
2121

22-
override fun removeListeners(count: Int) {
22+
override fun removeListeners(count: Double) {
2323
// Keep: Required for RN built in Event Emitter Calls
2424
}
2525

0 commit comments

Comments
 (0)