File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const Question: FC<QuestionProps> = (props: QuestionProps) => {
24
24
const toast = useToast ( )
25
25
26
26
const selectAnswer = ( optionIndex : number ) => {
27
- if ( optionsSelected . indexOf ( optionIndex ) !== - 1 ) {
27
+ if ( optionsSelected . includes ( optionIndex ) ) {
28
28
return setOptionsSelected (
29
29
optionsSelected . filter ( ( o ) => o !== optionIndex ) ,
30
30
)
@@ -36,7 +36,7 @@ const Question: FC<QuestionProps> = (props: QuestionProps) => {
36
36
}
37
37
38
38
const getOptionBackground = ( optionIndex : number ) => {
39
- if ( optionsSelected . indexOf ( optionIndex ) !== - 1 ) {
39
+ if ( optionsSelected . includes ( optionIndex ) ) {
40
40
return 'yellow.600'
41
41
}
42
42
return 'gray.600'
@@ -73,7 +73,7 @@ const Question: FC<QuestionProps> = (props: QuestionProps) => {
73
73
}
74
74
75
75
const submit = ( ) => {
76
- if ( optionsSelected . indexOf ( - 1 ) !== - 1 ) {
76
+ if ( optionsSelected . includes ( - 1 ) ) {
77
77
return quizNotAnswered ( )
78
78
}
79
79
You can’t perform that action at this time.
0 commit comments