Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tfhuhtal committed Sep 27, 2024
1 parent f196192 commit e639d76
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ const ModalAnswer = ({ question, faculty }) => {
return answers ? answers.find(answer => answer.programme === faculty)?.data || {} : {}
}, [answers, faculty])
const [showAll, setShowAll] = useState(false)
const lightsHistory = facultyAnswers[`${question.id}_lights_history`]?.reverse() || []
const displayedHistory = showAll ? lightsHistory : lightsHistory?.slice(0, 4).reverse()

const lightsHistory = facultyAnswers[`${question.id}_lights_history`] || []
const displayedHistory = showAll ? lightsHistory : lightsHistory.slice(Math.max(lightsHistory.length - 4, 0))
const formatDate = date => {
return new Date(date)
.toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric' })
Expand Down

0 comments on commit e639d76

Please sign in to comment.