Skip to content

Commit

Permalink
fix: evaluation error message issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Sep 25, 2024
1 parent 04552bd commit 33c76e8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/components/Modals/EvaluationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,16 @@ function submitEvaluation(close) {
},
onError(err) {
let message = err.messages?.[0] || err
let unavailabilityMessage = message.includes('unavailable')
let unavailabilityMessage
if (typeof message === 'string') {
unavailabilityMessage = message?.includes('unavailable')
} else {
unavailabilityMessage = false
}
createToast({
title: unavailabilityMessage ? 'Evaluator is Unavailable' : 'Error',
title: unavailabilityMessage ? __('Evaluator is Unavailable') : '',
text: message,
icon: unavailabilityMessage ? 'alert-circle' : 'x',
iconClasses: 'bg-yellow-600 text-white rounded-md p-px',
Expand Down

0 comments on commit 33c76e8

Please sign in to comment.