Skip to content

Commit

Permalink
Merge pull request #1934 from coopcycle/fix/range-null
Browse files Browse the repository at this point in the history
fixed: Cannot read property 'range' of null
  • Loading branch information
vladimir-8 authored Jan 2, 2025
2 parents 60cc013 + 2efe886 commit 9e66d9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ export function shouldShowPreOrder(restaurant) {
return false;
}

const timing = getNextShippingTime(restaurant);
const duration = moment.duration(
moment(restaurant.timing.delivery.range[0]).diff(moment()),
moment(timing.range[0]).diff(moment()),
);

return duration.asHours() > 0.75;
Expand Down

0 comments on commit 9e66d9a

Please sign in to comment.