Skip to content

Commit c529c87

Browse files
authored
update validations for naming && not activated stellar addresses (#1005)
1 parent 2b6216a commit c529c87

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/lib/widgets/add_farm.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ class _NewFarmState extends State<NewFarm> {
8383
nameError = "Name can't be empty";
8484
return false;
8585
}
86+
if (farmName.contains(' ')) {
87+
nameError = "Name can't contain spaces";
88+
return false;
89+
}
8690

8791
if (widget.isV4) {
8892
if (!isAlphanumeric(farmName)) {
@@ -108,6 +112,12 @@ class _NewFarmState extends State<NewFarm> {
108112
});
109113
return false;
110114
}
115+
if (_selectedWallet!.stellarBalance == '-1') {
116+
setState(() {
117+
walletError = 'Wallet not activated on stellar';
118+
});
119+
return false;
120+
}
111121
return true;
112122
}
113123

@@ -160,7 +170,7 @@ class _NewFarmState extends State<NewFarm> {
160170
}
161171

162172
Future<void> _validateAndAdd() async {
163-
if(!_validateWallet()) return;
173+
if (!_validateWallet()) return;
164174
final farmName = _nameController.text.trim();
165175
setState(() {
166176
saveLoading = true;

0 commit comments

Comments
 (0)