Skip to content

Commit

Permalink
fix: Redirect Links from App after Verification (#227)
Browse files Browse the repository at this point in the history
* add an anchor to prevent reload

* fix: Redirect Links from App after Verification

* document return_to anchor

adds a comment explaining why the url fragment is added

---------

Co-authored-by: Andy Wang <andy.wang@toolsforhumanity.com>
Co-authored-by: 0xPenryn <ian.dilick@toolsforhumanity.com>
  • Loading branch information
3 people authored Dec 28, 2023
1 parent 9712c83 commit a594e48
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ const QRState: FC<Props> = ({ qrData, showQR, setShowQR }) => {
<>
<div className="mb-10 space-y-4 md:hidden">
<motion.a
href={qrData ? qrData + `&return_to=${encodeURIComponent(window.location.href)}` : ''}
href={
qrData
// added a dummy anchor to prevent reload (and loss of state) when returning to website on mobile device
? qrData + `&return_to=${encodeURIComponent(window.location.href + '#prevent_reload')}`
: ''
}
whileTap={{ scale: 0.95 }}
whileHover={{ scale: 1.05 }}
transition={{ layout: { duration: 0.15 } }}
Expand Down

0 comments on commit a594e48

Please sign in to comment.