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:58:57 -04:00 committed by GitHub
parent da48b93929
commit 3fe7a18478
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -153,6 +153,16 @@ const ElectrumSettings: React.FC = () => {
setIsLoading(true);
try {
if (!host) {
presentAlert({ message: loc.settings.electrum_host_required });
setIsLoading(false);
return;
}
if (!port && !sslPort) {
presentAlert({ message: loc.settings.electrum_port_required });
setIsLoading(false);
return;
}
if (!host && !port && !sslPort) {
await AsyncStorage.removeItem(BlueElectrum.ELECTRUM_HOST);
await AsyncStorage.removeItem(BlueElectrum.ELECTRUM_TCP_PORT);