Skip to content

Recently Viewed Products Section is Re Rendered in PDP & Not tracking every time #2531

@pranoyvk

Description

@pranoyvk

Describe the Bug

  1. When I navigate to the PDP page for the first time, the "Recently Viewed Products" section is not shown because the current product is being excluded. We store the product in local storage after that, and then it is displayed on the PDP page. When we click on another route, the "Recently Viewed Products" section reloads and appears correctly.

  2. While using the router event, it does not track consistently. Sometimes, the data is not stored in local storage when the route changes.

I’m linking a video below — please take a look.

Screencast.from.25-06-25.08.04.15.PM.IST.webm

Expected Behavior

  1. The Recently Viewed Products section shouldn't re-render when I navigate to another route. However, it's clearly being re-rendered whenever the route changes.

  2. I want to store the Recently Viewed Products in local storage every time I open the URL in a private window or a new browser window.

To Reproduce

  1. Navigate to a product page (PDP). At the bottom, you can see the Recently Viewed Products section. When you navigate to another URL, the Recently Viewed Products section re-renders.

  2. You can open the project URL in a private or incognito window. Sometimes, the data is not stored in local storage/cache (though this is rare). It behaves inconsistently in such cases.

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