File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
lib/android/src/main/java/com/reactnativeldk Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1730,6 +1730,10 @@ object LdkEventEmitter {
17301730 this .reactContext = reactContext
17311731 }
17321732
1733+ fun getReactContext (): ReactContext ? {
1734+ return this .reactContext
1735+ }
1736+
17331737 fun send (eventType : EventTypes , body : Any ) {
17341738 if (this .reactContext == = null ) {
17351739 return
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class LdkPersister {
3939 file.writeBytes(serialized)
4040
4141 // Update chain monitor on main thread
42- LdkModule .reactContext ?.runOnUiThread {
42+ LdkModule .getReactContext() ?.runOnUiThread {
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 .reactContext ?.runOnUiThread {
78+ LdkModule .getReactContext() ?.runOnUiThread {
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} )" )
You can’t perform that action at this time.
0 commit comments