Skip to content

Commit

Permalink
fix: wcPayload broken state
Browse files Browse the repository at this point in the history
  • Loading branch information
isordo committed Nov 6, 2023
1 parent ea6a893 commit af996d9
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions packages/beacon-ui/src/ui/alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,14 @@ const openAlert = async (config: AlertConfig): Promise<string> => {
let link = ''

if (wallet.supportedInteractionStandards?.includes('wallet_connect')) {
const uri = (await wcPayload)?.uri
let uri
try {
uri = (await wcPayload)?.uri
} catch (error: any) {
console.error(error.message)
handleCloseAlert()
return
}
if (uri) {
link = `${wallet.links[OSLink.WEB]}/wc?uri=${encodeURIComponent(uri)}`
}
Expand Down Expand Up @@ -454,8 +461,14 @@ const openAlert = async (config: AlertConfig): Promise<string> => {
}

if (wallet && wallet.supportedInteractionStandards?.includes('wallet_connect')) {
const uri = (await wcPayload)?.uri

let uri
try {
uri = (await wcPayload)?.uri
} catch (error: any) {
console.error(error.message)
handleCloseAlert()
return
}
if (uri) {
if (isAndroid(window) || isIOS(window)) {
let link = `${wallet.links[OSLink.IOS]}/wc?uri=${encodeURIComponent(uri)}`
Expand Down

0 comments on commit af996d9

Please sign in to comment.