From 782c742a8f39bf430ad2c8bf5f395a3affabca62 Mon Sep 17 00:00:00 2001 From: horsefacts <109845214+horsefacts@users.noreply.github.com> Date: Thu, 22 Aug 2024 15:07:13 -0700 Subject: [PATCH] fix: use window.open for mobile links (#217) ## Change Summary Follow up to #200. Add changeset, use `window.open` in `SignInButton`. ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a changeset - [x] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [ ] PR includes documentation if necessary - [x] All commits have been signed --- .changeset/mean-baboons-collect.md | 5 +++++ .../auth-kit/src/components/SignInButton/SignInButton.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/mean-baboons-collect.md diff --git a/.changeset/mean-baboons-collect.md b/.changeset/mean-baboons-collect.md new file mode 100644 index 0000000..c738c04 --- /dev/null +++ b/.changeset/mean-baboons-collect.md @@ -0,0 +1,5 @@ +--- +"@farcaster/auth-kit": patch +--- + +fix: use window.open for mobile links diff --git a/packages/auth-kit/src/components/SignInButton/SignInButton.tsx b/packages/auth-kit/src/components/SignInButton/SignInButton.tsx index d2e0213..d640b90 100644 --- a/packages/auth-kit/src/components/SignInButton/SignInButton.tsx +++ b/packages/auth-kit/src/components/SignInButton/SignInButton.tsx @@ -81,7 +81,7 @@ export function SignInButton({ setShowDialog(true); signIn(); if (url && isMobile()) { - window.location.href = url; + window.open(url, "_blank"); } }, [isError, reconnect, signIn, url]);