Skip to content

Commit

Permalink
Fix sum
Browse files Browse the repository at this point in the history
  • Loading branch information
dqbd committed Oct 10, 2023
1 parent decfc56 commit f0a7e23
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/LogStream.tsx
Expand Up @@ -68,10 +68,11 @@ export function LogStream(props: {
({ timestamp }) => dayjs(timestamp).valueOf() <= displayDate.valueOf()
)

const sum = currentItem?.data.cart.items.reduce(
(memo, item) => item.price * item.qty + memo,
0
)
const sum =
currentItem?.data.cart.items.reduce(
(memo, item) => item.price * item.qty + memo,
0
) ?? 0

return (
<div
Expand Down

0 comments on commit f0a7e23

Please sign in to comment.