Skip to content

Commit

Permalink
Merge pull request #4 from edenia/feat/mm-mobile
Browse files Browse the repository at this point in the history
feat(webapp): test mm mobile
  • Loading branch information
AngeloCG97 committed Sep 26, 2023
2 parents a1046c1 + 88a46a9 commit a2e2146
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions webapp/src/components/Vmpxswap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,19 @@ const Vmpxswap = () => {
// Verificar si es un dispositivo móvil y MetaMask no está detectado
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent)
if (isMobile && !ethereum) {
// Intentar redirigir si es un dispositivo móvil
window.location.href = 'metamask:'
return
}

if (!ethereum) {
showMessage({
type: 'warning',
content: 'Make sure you have MetaMask installed!'
})
return
}

if (!ethereum) {
// Intentar usar MetaMask URI en dispositivos móviles
if (isMobile) {
window.location.href = 'metamask:'
return
} else {
showMessage({
type: 'warning',
content: 'Make sure you have MetaMask installed!'
})
return
}
}

// Continuar con la conexión si ethereum está disponible
await setSpecificChainMetaMask(ethereum)

Expand Down

0 comments on commit a2e2146

Please sign in to comment.