Add validation on node input in advanced privacy settings

This commit is contained in:
OmarHatem 2022-12-08 21:33:14 +02:00
parent 1ef8ef269c
commit ae1d2a3bec

View file

@ -78,7 +78,14 @@ class _AdvancedPrivacySettingsBodyState extends State<AdvancedPrivacySettingsBod
children: [
LoadingPrimaryButton(
onPressed: () {
widget.nodeViewModel.save(saveAsCurrent: true);
if (widget.privacySettingsViewModel.addCustomNode) {
if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
return;
}
widget.nodeViewModel.save(saveAsCurrent: true);
}
Navigator.pop(context);
},
text: S.of(context).continue_text,