From 0161c22401812d712ecfbae725b06022c54e2057 Mon Sep 17 00:00:00 2001 From: anthony Date: Thu, 28 Sep 2023 11:05:10 -0500 Subject: [PATCH] clear prior message; msg tweak for empty field --- core/fse.js | 1 + core/system_view_validate.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/fse.js b/core/fse.js index e6e7a9d18..b956f9646 100644 --- a/core/fse.js +++ b/core/fse.js @@ -167,6 +167,7 @@ exports.FullScreenEditorModule = var newFocusViewId; if (errMsgView) { if (err) { + errMsgView.clearText(); errMsgView.setText(err.message); if (MciViewIds.header.subject === err.view.getId()) { diff --git a/core/system_view_validate.js b/core/system_view_validate.js index 4c5521d18..8b4115afe 100644 --- a/core/system_view_validate.js +++ b/core/system_view_validate.js @@ -21,8 +21,10 @@ exports.validateEmailAvail = validateEmailAvail; exports.validateBirthdate = validateBirthdate; exports.validatePasswordSpec = validatePasswordSpec; +const emptyFieldError = () => new Error('Field cannot be empty'); + function validateNonEmpty(data, cb) { - return cb(data && data.length > 0 ? null : new Error('Field cannot be empty')); + return cb(data && data.length > 0 ? null : emptyFieldError); } function validateMessageSubject(data, cb) { @@ -91,6 +93,10 @@ function validateGeneralMailAddressedTo(data, cb) { // :TODO: remove hard-coded FTN check here. We need a decent way to register global supported flavors with modules. const addressedToInfo = getAddressedToInfo(data); + if (addressedToInfo.name.length === 0) { + return cb(emptyFieldError()); + } + if (Message.AddressFlavor.Local !== addressedToInfo.flavor) { return cb(null); }