Skip to content

fix(MyAccountLink): add returnUrl prop + fix HostedCart minicart glitch#747

Merged
acasazza merged 3 commits intov5.0.0from
fix/my-account-link-hosted-cart-v5
Apr 13, 2026
Merged

fix(MyAccountLink): add returnUrl prop + fix HostedCart minicart glitch#747
acasazza merged 3 commits intov5.0.0from
fix/my-account-link-hosted-cart-v5

Conversation

@acasazza
Copy link
Copy Markdown
Member

Changes

Backport of fixes from #740 onto v5.0.0.

🐛 Fix: MyAccountLink — add returnUrl prop (Closes #687)

Adds returnUrl?: string prop to MyAccountLink. Passes it through getOrganizationConfig params so mfe-my-account can render the "back to store" link and handle logout redirect.

🐛 Fix: HostedCart — minicart glitch on first visit (Closes #686)

On first visit with no orderId, the minicart was opening and closing immediately due to a race condition with createOrder(). Fixed with prevOpenRef to only call setOpen when the open prop itself changes. Also fixed subscription leak in unsubscribe.

♻️ Refactor: MyAccountLink — useEffect pattern (like MyIdentityLink)

Replace synchronous href + onClick with a useEffect that resolves org config on mount, falling back to getApplicationLink.

acasazza and others added 3 commits April 13, 2026 17:52
- Replace open !== isOpen check with prevOpenRef to only call setOpen
  when the open prop itself changes, not on unrelated effect re-runs
- Fix subscription leak: store openCartHandler in a named variable so
  unsubscribe passes the same reference as subscribe

Closes #686

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace synchronous href + onClick with useEffect that resolves
org config on mount, falling back to getApplicationLink.
@acasazza acasazza merged commit c86677a into v5.0.0 Apr 13, 2026
2 checks passed
@acasazza acasazza deleted the fix/my-account-link-hosted-cart-v5 branch April 13, 2026 15:57
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

Successfully merging this pull request may close these issues.

1 participant