Add validation in add account from hd path (#30)

* Add validation in add account from hd path

* Change app name
This commit is contained in:
IshaVenikar 2024-02-22 14:26:45 +05:30 committed by GitHub
parent 783758be39
commit 9199bc8e07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,3 @@
<resources> <resources>
<string name="app_name">laconic_wallet</string> <string name="app_name">Laconic</string>
</resources> </resources>

View File

@ -25,6 +25,10 @@ const HDPath = ({
}); });
const handleChange = (key: keyof PathState, value: string) => { const handleChange = (key: keyof PathState, value: string) => {
if (key === 'secondNumber' && value !== '' && !['0', '1'].includes(value)) {
return;
}
setPath({ setPath({
...path, ...path,
[key]: value.replace(/[^0-9]/g, ''), [key]: value.replace(/[^0-9]/g, ''),