Fixed rejection reason texts not showing the instance's text - see #6131

This commit is contained in:
Yair Morgenstern 2022-03-17 23:12:45 +02:00
parent bf0a44413f
commit ea362a448b

View File

@ -97,7 +97,11 @@ class RejectionReasons: HashSet<RejectionReasonInstance>() {
}
fun getMostImportantRejectionReason(): String? {
return orderOfErrorMessages.firstOrNull { contains(it) }?.errorMessage
for (rejectionReason in orderOfErrorMessages) {
val rejectionReasonInstance = firstOrNull { it.rejectionReason == rejectionReason }
if (rejectionReasonInstance != null) return rejectionReasonInstance.errorMessage
}
return null
}
// Used for constant variables in the functions above