Skip to content

Commit a2f777f

Browse files
authored
Reversed if else condition. More general toast error message should be placed in else block (#6004)
Tried to follow the design as used in other hooks. Most general error toast should be in else block. While serverTagUnavailable stuff should be in if block handling. This will help us having scope to add further error handling cases in future
1 parent 351bcbf commit a2f777f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/javascript/hooks/mutations/rooms/useStartMeeting.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export default function useStartMeeting(friendlyId) {
2929
window.location.href = joinUrl;
3030
},
3131
onError: (error) => {
32-
if (error.response.data.errors !== 'serverTagUnavailable') {
33-
toast.error(t('toast.error.problem_completing_action'));
34-
} else {
32+
if (error.response.data.errors === 'serverTagUnavailable') {
3533
toast.error(t('toast.error.server_type_unavailable'));
34+
} else {
35+
toast.error(t('toast.error.problem_completing_action'));
3636
}
3737
},
3838
},

0 commit comments

Comments
 (0)