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

Empty cart message pops up after placing an order #323

Closed
spencern opened this issue Sep 21, 2018 · 2 comments · Fixed by #332
Closed

Empty cart message pops up after placing an order #323

spencern opened this issue Sep 21, 2018 · 2 comments · Fixed by #332
Assignees
Labels
bug For issues that describe a defect or regression in the released software
Milestone

Comments

@spencern
Copy link
Contributor

I've not been able to capture a screenshot yet as it fades out quickly, but after placing an order, I'm seeing an empty cart message being shown in the bottom left corner of the screen on the order confirmation page.

@spencern spencern added the bug For issues that describe a defect or regression in the released software label Sep 21, 2018
@spencern spencern added this to the North Maroon milestone Sep 21, 2018
@aldeed
Copy link
Contributor

aldeed commented Sep 21, 2018

I've seen this, too. @willopez I don't have time to investigate further, but I suspect this is due to the refetchCart call you added in https://github.com/reactioncommerce/reaction-next-starterkit/pull/314/files. What probably happens is that sometimes it refetches before the cart is deleted and sometimes after. Also, I think it calls the Query callback again after the fetch, which might trigger Mobx to think it should open the mini cart.

Rather than refetch, can you just force Apollo to remove the cart from the cache by its ID? Don't even fetch from the server again, just force delete it from the client in the same place where you call cartStore.clearAnonymousCartCredentials(). Have to check Apollo docs to see if that's possible.

@willopez
Copy link
Member

@aldeed That might be the cause, I'll investigate. And it is possible to clear the cache for a query without refetching from that server. I'll give that a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a defect or regression in the released software
Projects
None yet
3 participants