Skip to content

enhancement: using useShopOrigin() after next JS router push #15

@ahmed-adly-khalil

Description

@ahmed-adly-khalil

Hello,
I'm having a minor issue with useShopOrigin() after redirecting between my app routes using next JS router push, for ex: router.push("/new-page");

after looking into the source code and knowing that useShopOrigin use window.location.search means it depends on the shop param in the app URL after successful authentication.

I think this is fair assumption, I can simply maintain the shop and other params using next router push options as described here: https://nextjs.org/docs/api-reference/next/router

router.push({
          pathname: '/post/[pid]',
          query: { pid: post.id },
        })

as an enhancement, it would be great if useShopOrigin to read the shop from the session token like how useApi works

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions