mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-24 07:28:07 +01:00
Update screen/settings/ElectrumSettings.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
6a16eb806e
commit
03c100048a
1 changed files with 4 additions and 14 deletions
|
@ -403,22 +403,12 @@ const ElectrumSettings: React.FC = () => {
|
|||
value={sslPort?.toString() === '' || sslPort === undefined ? port?.toString() || '' : sslPort?.toString() || ''}
|
||||
onChangeText={text => {
|
||||
const parsed = Number(text.trim());
|
||||
if (isNaN(parsed)) {
|
||||
// Handle invalid input, e.g., set to undefined or show an error
|
||||
if (sslPort === undefined) {
|
||||
setPort(undefined);
|
||||
} else {
|
||||
setSslPort(undefined);
|
||||
}
|
||||
if (Number.isNaN(parsed)) {
|
||||
// Handle invalid input
|
||||
sslPort === undefined ? setPort(undefined) : setSslPort(undefined);
|
||||
return;
|
||||
}
|
||||
if (sslPort === undefined) {
|
||||
setPort(parsed);
|
||||
setSslPort(undefined);
|
||||
} else {
|
||||
setPort(undefined);
|
||||
setSslPort(parsed);
|
||||
}
|
||||
sslPort === undefined ? setPort(parsed) : setSslPort(parsed);
|
||||
}}
|
||||
numberOfLines={1}
|
||||
style={[styles.inputText, stylesHook.inputText]}
|
||||
|
|
Loading…
Add table
Reference in a new issue