Skip to content

Commit 1ae2063

Browse files
authored
Merge pull request #295 from synonymdev/fix/rn-0.78-compatibility
Fix/rn 0.78 compatibility
2 parents efc40ef + dc0f808 commit 1ae2063

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ example/.watchman*
66
# docker
77
example/docker/lnd/
88
example/docker/clightning/
9+
10+
#AI
11+
CLAUDE.md

example/metro.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const config = {
2020
vm: path.resolve(__dirname, 'node_modules/vm-browserify/'),
2121
process: path.resolve(__dirname, 'node_modules/process/'),
2222
},
23+
blockList: [
24+
// Exclude nested node_modules in the lib package to avoid bundling conflicts
25+
/node_modules\/@synonymdev\/react-native-ldk\/node_modules\/.*/,
26+
],
2327
},
2428
};
2529

example/tests/eclair.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ describe('Eclair', function () {
113113
channelCloseMinimum: 5,
114114
outputSpendingFee: 10,
115115
urgentOnChainSweep: 30,
116-
maximumFeeEstimate: 30
116+
maximumFeeEstimate: 30,
117117
});
118118
},
119119
});

lib/android/src/main/java/com/reactnativeldk/LdkModule.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

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.reactContext?.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.reactContext?.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})")

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@synonymdev/react-native-ldk",
33
"title": "React Native LDK",
4-
"version": "0.0.161",
4+
"version": "0.0.162",
55
"description": "React Native wrapper for LDK",
66
"main": "./dist/index.js",
77
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)