fix(android): apply LDK and LND persistent mode toggles without app restart

This commit is contained in:
Evan Kaloudis
2026-05-29 13:25:31 -04:00
parent b4de7224aa
commit 4cd0437599
9 changed files with 164 additions and 28 deletions
+1
View File
@@ -474,6 +474,7 @@ export interface ILdkNodeModule {
start(): Promise<void>;
stop(): Promise<void>;
syncWallets(): Promise<void>;
setPersistentMode(enabled: boolean): Promise<void>;
// Node Info Methods
nodeId(): Promise<string>;
+8 -1
View File
@@ -3,7 +3,7 @@
* Similar pattern to LndMobileInjection
*/
import { NativeModules } from 'react-native';
import { NativeModules, Platform } from 'react-native';
import RNFS from 'react-native-fs';
import { generateVssAuthHeaders } from '../utils/VssAuthUtils';
import type {
@@ -171,6 +171,11 @@ const syncWallets = async (): Promise<void> => {
return await LdkNodeModule.syncWallets();
};
const setPersistentMode = async (enabled: boolean): Promise<void> => {
if (Platform.OS !== 'android') return;
return await LdkNodeModule.setPersistentMode(enabled);
};
// ============================================================================
// Node Info Functions
// ============================================================================
@@ -1025,6 +1030,7 @@ export interface ILdkNodeInjections {
start: () => Promise<void>;
stop: () => Promise<void>;
syncWallets: () => Promise<void>;
setPersistentMode: (enabled: boolean) => Promise<void>;
nodeId: () => Promise<string>;
status: () => Promise<NodeStatus>;
listBalances: () => Promise<BalanceDetails>;
@@ -1273,6 +1279,7 @@ const LdkNodeInjection: ILdkNodeInjections = {
start,
stop,
syncWallets,
setPersistentMode,
nodeId,
status,
listBalances,