diff --git a/src/screens/Settings/DevSettings/LdkDebug.tsx b/src/screens/Settings/DevSettings/LdkDebug.tsx index d7a408dd7..e24ff5462 100644 --- a/src/screens/Settings/DevSettings/LdkDebug.tsx +++ b/src/screens/Settings/DevSettings/LdkDebug.tsx @@ -76,7 +76,14 @@ const LdkDebug = (): ReactElement => { const onRestartLdk = async (): Promise => { setRestartingLdk(true); - await setupLdk({ selectedWallet, selectedNetwork }); + const res = await setupLdk({ selectedWallet, selectedNetwork }); + if (res.isErr()) { + showToast({ + type: 'error', + title: t('wallet:ldk_start_error_title'), + description: res.error.message, + }); + } setRestartingLdk(false); }; diff --git a/src/screens/Settings/RGSServer/index.tsx b/src/screens/Settings/RGSServer/index.tsx index 29f3bd7de..e8dfd43c0 100644 --- a/src/screens/Settings/RGSServer/index.tsx +++ b/src/screens/Settings/RGSServer/index.tsx @@ -74,15 +74,23 @@ const RGSServer = ({ const connectToRGSServer = async (): Promise => { setLoading(true); dispatch(updateSettings({ rapidGossipSyncUrl: rgsUrl })); - await setupLdk({ + const res = await setupLdk({ selectedWallet, selectedNetwork, }); - showToast({ - type: 'success', - title: t('rgs.update_success_title'), - description: t('rgs.update_success_description'), - }); + if (res.isOk()) { + showToast({ + type: 'success', + title: t('rgs.update_success_title'), + description: t('rgs.update_success_description'), + }); + } else { + showToast({ + type: 'error', + title: t('wallet:ldk_start_error_title'), + description: res.error.message, + }); + } setLoading(false); }; diff --git a/src/utils/i18n/locales/en/wallet.json b/src/utils/i18n/locales/en/wallet.json index 7fcef6444..3be1e336f 100644 --- a/src/utils/i18n/locales/en/wallet.json +++ b/src/utils/i18n/locales/en/wallet.json @@ -681,6 +681,9 @@ "ldk_sync_error_title": { "string": "Lightning Sync Error" }, + "ldk_start_error_title": { + "string": "Lightning Startup Error" + }, "receive_insufficient_title": { "string": "Insufficient receiving balance." }, diff --git a/src/utils/lightning/index.ts b/src/utils/lightning/index.ts index 4b3130b02..a412b238b 100644 --- a/src/utils/lightning/index.ts +++ b/src/utils/lightning/index.ts @@ -781,6 +781,11 @@ export const refreshLdk = async ({ shouldPreemptivelyStopLdk: false, }); if (setupResponse.isErr()) { + showToast({ + type: 'error', + title: i18n.t('wallet:ldk_start_error_title'), + description: setupResponse.error.message, + }); return handleRefreshError(setupResponse.error.message); } keepLdkSynced({ selectedNetwork }).then(); diff --git a/src/utils/startup/index.ts b/src/utils/startup/index.ts index dd829ebf5..1318dcc65 100644 --- a/src/utils/startup/index.ts +++ b/src/utils/startup/index.ts @@ -26,6 +26,7 @@ import { TWalletName } from '../../store/types/wallet'; import { runChecks } from '../wallet/checks'; import { setupLedger, syncLedger } from '../ledger'; import i18n from '../i18n'; +import { showToast } from '../notifications'; /** * Creates a new wallet from scratch @@ -153,6 +154,12 @@ export const startWalletServices = async ({ }); if (setupResponse.isOk()) { keepLdkSynced({ selectedNetwork }).then(); + } else { + showToast({ + type: 'error', + title: i18n.t('wallet:ldk_start_error_title'), + description: setupResponse.error.message, + }); } }