Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isOptimistic for CartLineItem only works when added to cart, not when updating or removing the line #2673

Open
octave opened this issue Dec 12, 2024 · 1 comment

Comments

@octave
Copy link

octave commented Dec 12, 2024

What is the location of your example repository?

Use Skeleton-template

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2024.10.1

What version of Remix are you using?

2.13.1

Steps to Reproduce

On a fresh install npm create @shopify/hydrogen@latest -- --quickstart add a console log in the CartLineItem.jsx file:

export function CartLineItem({layout, line}) {
  const {id, merchandise} = line;
  const {product, title, image, selectedOptions} = merchandise;
  const lineItemUrl = useVariantUrl(product.handle, selectedOptions);
  const {close} = useAside();
  console.log('line optimistic', line.isOptimistic);

Expected Behavior

line.isOptimistic should be true when adding, updating or removing a line.

Actual Behavior

line.isOptimistic only return true when adding a line.

@octave
Copy link
Author

octave commented Dec 17, 2024

Has anyone got a chance to look into 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

No branches or pull requests

1 participant