Skip to content

Commit

Permalink
Merge pull request #298 from Louis-htmlcss/fixbete
Browse files Browse the repository at this point in the history
Refactor HomeworksElement to handle empty hwFinalList and hwFinalList2
  • Loading branch information
ecnivtwelve authored Oct 27, 2024
2 parents d76b5cd + 289480f commit 9b64232
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/account/Home/Elements/HomeworksElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ const HomeworksElement = ({ navigation }: HomeworksElementProps) => {
}}
/>
))}
{new Date().getDay() >= 2 && hwFinalList2 && hwFinalList2.length > 0 && hwFinalList2.map((hw, index) => (
{new Date().getDay() >= 2 && hwFinalList2.length > 0 && hwFinalList2.map((hw, index) => (
<HomeworkItem
homework={hw}
key={index}
index={index}
navigation={navigation}
total={homeworks[dateToEpochWeekNumber(actualDay) + 1].length}
total={homeworks[dateToEpochWeekNumber(actualDay) + 1]?.length || 0}
onDonePressHandler={() => {
handleDonePress(hw);
}}
Expand Down

0 comments on commit 9b64232

Please sign in to comment.