diff --git a/ios/BlueWallet/Info.plist b/ios/BlueWallet/Info.plist index 5fcc7826a..d7b145bf5 100644 --- a/ios/BlueWallet/Info.plist +++ b/ios/BlueWallet/Info.plist @@ -137,7 +137,7 @@ NSAppTransportSecurity NSAllowsArbitraryLoads - + NSAllowsLocalNetworking NSExceptionDomains diff --git a/screen/settings/LightningSettings.tsx b/screen/settings/LightningSettings.tsx index aeb30a8cc..9f54d359e 100644 --- a/screen/settings/LightningSettings.tsx +++ b/screen/settings/LightningSettings.tsx @@ -100,29 +100,28 @@ const LightningSettings: React.FC = () => { setURI(typeof setLndHubUrl === 'string' ? setLndHubUrl.trim() : value.trim()); }; - const save = useCallback(async () => { - setIsLoading(true); - try { - await DefaultPreference.setName(GROUP_IO_BLUEWALLET); - if (URI) { - const normalizedURI = new URL(URI.replace(/([^:]\/)\/+/g, '$1')).toString(); +const save = useCallback(async () => { + setIsLoading(true); + try { + await DefaultPreference.setName(GROUP_IO_BLUEWALLET); + if (URI) { + const normalizedURI = new URL(URI.replace(/([^:]\/)\/+/g, '$1')).toString(); + await LightningCustodianWallet.isValidNodeAddress(normalizedURI); - await LightningCustodianWallet.isValidNodeAddress(normalizedURI); - - await setLNDHub(normalizedURI); - } else { - await clearLNDHub(); - } - - presentAlert({ message: loc.settings.lightning_saved, type: AlertType.Toast }); - triggerHapticFeedback(HapticFeedbackTypes.NotificationSuccess); - } catch (error) { - triggerHapticFeedback(HapticFeedbackTypes.NotificationError); - presentAlert({ message: loc.settings.lightning_error_lndhub_uri }); - console.log(error); + await setLNDHub(normalizedURI); + } else { + await clearLNDHub(); } - setIsLoading(false); - }, [URI]); + + presentAlert({ message: loc.settings.lightning_saved, type: AlertType.Toast }); + triggerHapticFeedback(HapticFeedbackTypes.NotificationSuccess); + } catch (error) { + triggerHapticFeedback(HapticFeedbackTypes.NotificationError); + presentAlert({ message: loc.settings.lightning_error_lndhub_uri }); + console.log(error); + } + setIsLoading(false); +}, [URI]); const importScan = () => { navigate('ScanQRCode', {