Skip to content

Commit

Permalink
fix: add UI notification
Browse files Browse the repository at this point in the history
  • Loading branch information
isordo committed Dec 5, 2023
1 parent 8152ff7 commit e5ebbc4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/beacon-ui/src/components/pair-other/pair-other.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ const PairOther: Component<PairOtherProps> = (props: PairOtherProps) => {
setQrData(codeQR)
})
} else if (state === 'walletconnect' && !!props.wcPayload) {
props.wcPayload.then(async (payload) => {
setQrData(payload.uri)
})
props.wcPayload
.then((payload) => {
setQrData(payload.uri)
})
.catch((error) => console.error(error.message))
}
setUiState(state)
}
Expand Down
13 changes: 13 additions & 0 deletions packages/beacon-ui/src/ui/alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,13 @@ const openAlert = async (config: AlertConfig): Promise<string> => {
const uri = (await wcPayload)?.uri ?? ''
if (!!uri.length) {
link = `${wallet.links[OSLink.WEB]}/wc?uri=${encodeURIComponent(uri)}`
} else {
handleCloseAlert()
setTimeout(() => openAlert({
title: 'Error',
body: 'Unexpected transport error. Please try again'
}), 500)
return
}
} else {
const serializer = new Serializer()
Expand Down Expand Up @@ -475,6 +482,12 @@ const openAlert = async (config: AlertConfig): Promise<string> => {
setCodeQR(uri)
setCurrentInfo('install')
}
} else {
handleCloseAlert()
setTimeout(() => openAlert({
title: 'Error',
body: 'Unexpected transport error. Please try again'
}), 500)
}
setIsLoading(false)
} else if (wallet?.types.includes('ios') && _isMobileOS) {
Expand Down

0 comments on commit e5ebbc4

Please sign in to comment.