Skip to content

Fix cart items reordering using Array.map transform#87

Open
niranad wants to merge 1 commit intoadrianhajdin:mainfrom
niranad:CartReorderBugFix
Open

Fix cart items reordering using Array.map transform#87
niranad wants to merge 1 commit intoadrianhajdin:mainfrom
niranad:CartReorderBugFix

Conversation

@niranad
Copy link
Copy Markdown

@niranad niranad commented Dec 12, 2022

#toggleCartItemQuantity function in stateContext
Reordering of cart products is due to filtering the cart items to remove the found product followed by appending the mutated found product to the end of the cart. Instead, simply mapping over the items and returning an updated item for the specific item we are searching would preserve the order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant