Add validation on node input in advanced privacy settings

OmarHatem committed Dec 8, 2022 at 21:33 UTC ae1d2a3bec79d2f3ba394232fda84db7e06fd1c2
1 file changed +8 -1
lib/src/screens/new_wallet/advanced_privacy_settings_page.dart
+8 -1
@@ -78,7 +78,14 @@ class _AdvancedPrivacySettingsBodyState extends State<AdvancedPrivacySettingsBod
78 children: [
79 LoadingPrimaryButton(
80 onPressed: () {
81 - widget.nodeViewModel.save(saveAsCurrent: true);
81 + if (widget.privacySettingsViewModel.addCustomNode) {
82 + if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
83 + return;
84 + }
85 +
86 + widget.nodeViewModel.save(saveAsCurrent: true);
87 + }
88 +
89 Navigator.pop(context);
90 },
91 text: S.of(context).continue_text,