Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
1fde2504
Unverified
Commit
1fde2504
authored
Jul 28, 2023
by
cartcrom
Committed by
GitHub
Jul 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use deeplink instead of universal link (#7017)
* fix: use deeplink instead of universal link * docs: added comment
parent
6a3abbfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
UniwalletModal.tsx
src/components/AccountDrawer/UniwalletModal.tsx
+3
-1
WalletConnectV2.ts
src/connection/WalletConnectV2.ts
+3
-4
No files found.
src/components/AccountDrawer/UniwalletModal.tsx
View file @
1fde2504
...
@@ -13,6 +13,7 @@ import { QRCodeSVG } from 'qrcode.react'
...
@@ -13,6 +13,7 @@ import { QRCodeSVG } from 'qrcode.react'
import
{
useEffect
,
useState
}
from
'
react
'
import
{
useEffect
,
useState
}
from
'
react
'
import
styled
,
{
useTheme
}
from
'
styled-components/macro
'
import
styled
,
{
useTheme
}
from
'
styled-components/macro
'
import
{
CloseIcon
,
ThemedText
}
from
'
theme
'
import
{
CloseIcon
,
ThemedText
}
from
'
theme
'
import
{
isIOS
}
from
'
utils/userAgent
'
import
uniPng
from
'
../../assets/images/uniwallet_modal_icon.png
'
import
uniPng
from
'
../../assets/images/uniwallet_modal_icon.png
'
import
{
DownloadButton
}
from
'
./DownloadButton
'
import
{
DownloadButton
}
from
'
./DownloadButton
'
...
@@ -41,8 +42,9 @@ export default function UniwalletModal() {
...
@@ -41,8 +42,9 @@ export default function UniwalletModal() {
const
{
activationState
,
cancelActivation
}
=
useActivationState
()
const
{
activationState
,
cancelActivation
}
=
useActivationState
()
const
[
uri
,
setUri
]
=
useState
<
string
>
()
const
[
uri
,
setUri
]
=
useState
<
string
>
()
// Displays the modal if
a Uniswap Wallet Connection is pending
& qrcode URI is available
// Displays the modal if
not on iOS, a Uniswap Wallet Connection is pending,
& qrcode URI is available
const
open
=
const
open
=
!
isIOS
&&
activationState
.
status
===
ActivationStatus
.
PENDING
&&
activationState
.
status
===
ActivationStatus
.
PENDING
&&
activationState
.
connection
.
type
===
ConnectionType
.
UNISWAP_WALLET_V2
&&
activationState
.
connection
.
type
===
ConnectionType
.
UNISWAP_WALLET_V2
&&
!!
uri
!!
uri
...
...
src/connection/WalletConnectV2.ts
View file @
1fde2504
...
@@ -83,10 +83,9 @@ export class UniwalletConnect extends WalletConnectV2 {
...
@@ -83,10 +83,9 @@ export class UniwalletConnect extends WalletConnectV2 {
// Opens deeplink to Uniswap Wallet if on iOS
// Opens deeplink to Uniswap Wallet if on iOS
if
(
isIOS
)
{
if
(
isIOS
)
{
const
newTab
=
window
.
open
(
`https://uniswap.org/app/wc?uri=
${
encodeURIComponent
(
uri
)}
`
)
// Using window.location.href to open the deep link ensures smooth navigation and leverages OS handling for installed apps,
// avoiding potential popup blockers or inconsistent behavior associated with window.open
// Fixes blank tab opening on mobile Chrome
window
.
location
.
href
=
`uniswap://wc?uri=
${
encodeURIComponent
(
uri
)}
`
newTab
?.
close
()
}
}
})
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment