Skip to content

Update cart.js#1

Open
syed-ghufran-hassan wants to merge 1 commit into
ayezabashir:mainfrom
syed-ghufran-hassan:patch-1
Open

Update cart.js#1
syed-ghufran-hassan wants to merge 1 commit into
ayezabashir:mainfrom
syed-ghufran-hassan:patch-1

Conversation

@syed-ghufran-hassan
Copy link
Copy Markdown

fix(cart): prevent runtime error when changing quantity of missing product

  • Guard against indexProductId === -1 in changeQuantity reducer
  • Safely ignore updates for products not in cart
  • Use splice() for efficient single-item removal
  • Maintain localStorage sync

Also refactor(cart): minor improvements

  • Use !state.statusTab for cleaner toggle

fix(cart): prevent runtime error when changing quantity of missing product

- Guard against indexProductId === -1 in changeQuantity reducer
- Safely ignore updates for products not in cart
- Use splice() for efficient single-item removal
- Maintain localStorage sync

Also refactor(cart): minor improvements
- Use !state.statusTab for cleaner toggle
@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 11, 2025

@syed-ghufran-hassan is attempting to deploy a commit to the Ayeza Bashir's projects Team on Vercel.

A member of the Team first needs to authorize it.

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