fix(android): apply LDK and LND persistent mode toggles without app restart
This commit is contained in:
Vendored
+1
@@ -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>;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user