-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[react] feat/restore critical exp (#667)
* replace metrics * Squashed update metrics with span attributes * fix export countItems and clean up logs * remove config-overrides.js --------- Co-authored-by: sergiosentry <[email protected]>
- Loading branch information
1 parent
9cea64b
commit 9f4a850
Showing
6 changed files
with
108 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ express/node_modules | |
/.pnp | ||
.pnp.js | ||
.vercel | ||
react/config-overrides.js | ||
|
||
# testing | ||
/coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export function countItemsInCart(cart) { | ||
let totalItems = 0; | ||
|
||
if (!cart || !cart.quantities) { | ||
console.log("Cart or cart.quantities is undefined!"); | ||
return totalItems; | ||
} | ||
|
||
totalItems = Object.values(cart.quantities) | ||
.reduce((sum, quantity) => { | ||
console.log("Adding quantity:", quantity); | ||
return sum + quantity; | ||
}, 0); | ||
|
||
return totalItems; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters