Skip to content

Minicart -- Race condition occasionally hides it #59

@bhartvigsen

Description

@bhartvigsen

I noticed that occasionally the minicart disappears, it appears to be somehow related to viewport size but it's clearly a race condition. I'm not sure of the root cause, but this line:

<div ng-show="currentOrder && cartCount && !isInPath(\'order/\')">

Is the symptom. Occasionally pages will load and "cartCount" is undefined. It's a race condition that occurs earlier in the page load, and if "cartCount" is not set, it will never be set for that page load.

I'm currently using this line instead:

<div ng-show="currentOrder || cartCount">

Which works, however it's probably not the best solution. The proper fix would be to resolve why "cartCount" is sometimes failing to set on pageload. For some reason the issue is more likely to occur when my viewport is roughly 1096px wide, but it doesn't always happen. I found I could trigger the issue by moving my viewport around the 1096 mark and doing a hard refresh. If I resize, refresh, resize, refresh, etc, I'm able to somewhat reliably reproduce the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions