Skip to content

Commit

Permalink
Merge pull request #26 from the-collab-lab/hotfix-listItem-bug
Browse files Browse the repository at this point in the history
conditional datePurchased
  • Loading branch information
Wyna-7 authored Sep 10, 2024
2 parents 1ae8026 + 6d76fb8 commit 7a24d2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function ListItem({ name, listPath, id, isChecked, datePurchased }) {

useEffect(() => {
const today = new Date().getTime();
const datePurchasedInMillis = datePurchased.toMillis();
const datePurchasedInMillis = datePurchased?.toMillis();

if (isChecked && today - datePurchasedInMillis >= ONE_DAY_IN_MILLISECONDS) {
updateItem(listPath, id, !isChecked);
Expand Down

0 comments on commit 7a24d2f

Please sign in to comment.