mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-22 10:34:17 +01:00
fix empty string case (#1401)
* bio auth mac fix * remove comment and change duration from 2 to 0 * cherry pick previous changes * fix empty string case * add support for path for all currency types * disable paths on electrum and monero nodes * undo mac auth changes * stuff I missed * 1 last thing * another thing I missed
This commit is contained in:
@@ -11,5 +11,9 @@ class NodeAddressValidator extends TextValidator {
|
||||
|
||||
class NodePathValidator extends TextValidator {
|
||||
NodePathValidator()
|
||||
: super(errorMessage: S.current.error_text_node_address, pattern: '^([/0-9a-zA-Z.\-]+)?\$');
|
||||
: super(
|
||||
errorMessage: S.current.error_text_node_address,
|
||||
pattern: '^([/0-9a-zA-Z.\-]+)?\$',
|
||||
isAutovalidate: true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,4 +29,4 @@ class BiometricAuth {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -955,4 +955,4 @@ String get todayLabel => 'Oyọ';
|
||||
|
||||
@override
|
||||
String get noSpellCheckReplacementsLabel => "";
|
||||
}
|
||||
}
|
||||
@@ -96,18 +96,20 @@ class NodeForm extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10.0),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: BaseTextFormField(
|
||||
controller: _pathController,
|
||||
hintText: "/path",
|
||||
validator: NodePathValidator(),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10.0),
|
||||
if (nodeViewModel.hasPathSupport) ...[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: BaseTextFormField(
|
||||
controller: _pathController,
|
||||
hintText: "/path",
|
||||
validator: NodePathValidator(),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10.0),
|
||||
],
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
|
||||
@@ -167,4 +167,4 @@ class ValidatableAnnotatedEditableTextState extends EditableTextState {
|
||||
|
||||
return TextSpan(style: widget.style, text: text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,4 +125,4 @@ abstract class AuthViewModelBase with Store {
|
||||
_authService.saveLastAuthTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,24 @@ abstract class NodeCreateOrEditViewModelBase with Store {
|
||||
|
||||
bool get hasTestnetSupport => _walletType == WalletType.bitcoin;
|
||||
|
||||
bool get hasPathSupport {
|
||||
switch (_walletType) {
|
||||
case WalletType.ethereum:
|
||||
case WalletType.polygon:
|
||||
case WalletType.solana:
|
||||
case WalletType.banano:
|
||||
case WalletType.nano:
|
||||
return true;
|
||||
case WalletType.none:
|
||||
case WalletType.monero:
|
||||
case WalletType.haven:
|
||||
case WalletType.litecoin:
|
||||
case WalletType.bitcoinCash:
|
||||
case WalletType.bitcoin:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
String get uri {
|
||||
var uri = address;
|
||||
|
||||
@@ -217,7 +235,6 @@ abstract class NodeCreateOrEditViewModelBase with Store {
|
||||
final port = uri.port.toString();
|
||||
final path = uri.path;
|
||||
|
||||
|
||||
setAddress(ipAddress);
|
||||
setPath(path);
|
||||
setPassword(rpcPassword);
|
||||
|
||||
Reference in New Issue
Block a user