diff --git a/example/Dev.tsx b/example/Dev.tsx index f01f31c5..f7084f25 100644 --- a/example/Dev.tsx +++ b/example/Dev.tsx @@ -12,14 +12,7 @@ import { View, } from 'react-native'; import Clipboard from '@react-native-clipboard/clipboard'; -import { - backupAccount, - getAddressBalance, - importAccount, - setupLdk, - syncLdk, - updateHeader, -} from './ldk'; +import { getAddressBalance, setupLdk, syncLdk, updateHeader } from './ldk'; import { connectToElectrum, subscribeToHeader } from './electrum'; import ldk from '@synonymdev/react-native-ldk/dist/ldk'; import lm, { @@ -31,12 +24,7 @@ import lm, { TChannelUpdate, } from '@synonymdev/react-native-ldk'; import { backupServerDetails, peers } from './utils/constants'; -import { - createNewAccount, - getAccount, - getAddress, - simulateStaleRestore, -} from './utils/helpers'; +import { createNewAccount, getAccount, getAddress } from './utils/helpers'; import RNFS from 'react-native-fs'; let logSubscription: EmitterSubscription | undefined; @@ -44,7 +32,6 @@ let paymentSubscription: EmitterSubscription | undefined; let onChannelSubscription: EmitterSubscription | undefined; let paymentFailedSubscription: EmitterSubscription | undefined; let paymentPathSuccess: EmitterSubscription | undefined; -let backupSubscriptionId: string | undefined; const Dev = (): ReactElement => { const [message, setMessage] = useState('...'); @@ -144,25 +131,12 @@ const Dev = (): ReactElement => { ); } - if (!backupSubscriptionId) { - backupSubscriptionId = lm.subscribeToBackups((backupRes) => { - if (backupRes.isErr()) { - return alert('Backup required but failed to export account'); - } - - console.log( - `Backup updated for account ${backupRes.value.account.name}`, - ); - }); - } - return (): void => { logSubscription && logSubscription.remove(); paymentSubscription && paymentSubscription.remove(); paymentFailedSubscription && paymentFailedSubscription.remove(); paymentPathSuccess && paymentPathSuccess.remove(); onChannelSubscription && onChannelSubscription.remove(); - backupSubscriptionId && lm.unsubscribeFromBackups(backupSubscriptionId); }; }, []); @@ -589,50 +563,6 @@ const Dev = (): ReactElement => { }} /> -