Skip to content

Commit

Permalink
Rename method as feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangzinh committed Jul 6, 2023
1 parent cc29b60 commit 910780c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libs/ErrorUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function getLatestErrorField(onyxData, fieldName) {
* @param {String} fieldName
* @returns {Object}
*/
function getFirstErrorField(onyxData, fieldName) {
function getEarliestErrorField(onyxData, fieldName) {
const errorsForField = lodashGet(onyxData, ['errorFields', fieldName], {});

if (_.isEmpty(errorsForField)) {
Expand Down Expand Up @@ -132,4 +132,4 @@ function addErrorMessage(errors, inputID, message) {
}
}

export {getAuthenticateErrorMessage, getMicroSecondOnyxError, getLatestErrorMessage, getLatestErrorField, getFirstErrorField, addErrorMessage};
export {getAuthenticateErrorMessage, getMicroSecondOnyxError, getLatestErrorMessage, getLatestErrorField, getEarliestErrorField, addErrorMessage};
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function BaseValidateCodeForm(props) {
</OfflineWithFeedback>
<OfflineWithFeedback
pendingAction={lodashGet(loginData, 'pendingFields.validateLogin', null)}
errors={ErrorUtils.getFirstErrorField(loginData, 'validateLogin')}
errors={ErrorUtils.getEarliestErrorField(loginData, 'validateLogin')}
errorRowStyles={[styles.mt2]}
onClose={() => User.clearContactMethodErrors(props.contactMethod, 'validateLogin')}
>
Expand Down

0 comments on commit 910780c

Please sign in to comment.