Skip to content

Commit 43e58e2

Browse files
committed
fix: ReactContext doesn't have a runOnUiThread() method in React Native 0.78. The correct method is runOnUiQueueThread()
1 parent a129cb4 commit 43e58e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/android/src/main/java/com/reactnativeldk/classes/LdkPersister.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class LdkPersister {
3939
file.writeBytes(serialized)
4040

4141
// Update chain monitor on main thread
42-
LdkModule.getReactContext()?.runOnUiThread {
42+
LdkEventEmitter.getReactContext()?.runOnUiQueueThread {
4343
val res = LdkModule.chainMonitor?.channel_monitor_updated(channelFundingOutpoint, data._latest_update_id)
4444
if (res == null || !res.is_ok) {
4545
LdkEventEmitter.send(EventTypes.native_log, "Failed to update chain monitor with persisted channel (${channelId})")
@@ -75,7 +75,7 @@ class LdkPersister {
7575
}
7676

7777
//Update chain monitor with successful persist on main thread
78-
LdkModule.getReactContext()?.runOnUiThread {
78+
LdkEventEmitter.getReactContext()?.runOnUiQueueThread {
7979
val res = LdkModule.chainMonitor?.channel_monitor_updated(channelFundingOutpoint, data._latest_update_id)
8080
if (res == null || !res.is_ok) {
8181
LdkEventEmitter.send(EventTypes.native_log, "Failed to update chain monitor with persisted channel (${channelId})")

0 commit comments

Comments
 (0)