Update screen/settings/ElectrumSettings.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Marcos Rodriguez Vélez 2024-10-15 23:57:28 -04:00 committed by GitHub
parent 8dee980946
commit da48b93929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -278,9 +278,14 @@ const ElectrumSettings: React.FC = () => {
const checkServer = async () => {
setIsLoading(true);
const features = await BlueElectrum.serverFeatures();
triggerHapticFeedback(HapticFeedbackTypes.NotificationWarning);
presentAlert({ message: JSON.stringify(features, null, 2) });
try {
const features = await BlueElectrum.serverFeatures();
triggerHapticFeedback(HapticFeedbackTypes.NotificationWarning);
presentAlert({ message: JSON.stringify(features, null, 2) });
} catch (error) {
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
presentAlert({ message: loc.settings.electrum_server_error });
}
setIsLoading(false);
};