Skip to content

Commit

Permalink
Add appropriate error message for wrong user in ambire extension
Browse files Browse the repository at this point in the history
  • Loading branch information
JIOjosBG committed Jul 2, 2024
1 parent d384639 commit 00da4d1
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,19 @@ const Actions = ({
})
.catch((e) => {
if (isMounted.current) setSigningStatus(null)
console.error(e)
if (e && e.message.includes('must provide an Ethereum address')) {
console.error(e)
if(!e || !e.message) {
addToast(`Signing error: Unknown error`, { error: true })
} else if (
e.message.includes('must provide an Ethereum address') ||
// used for ambire extension
e.message.includes('must use the current user address to sign')
){
addToast(
`Signing error: not connected with the correct address. Make sure you're connected with ${bundle.signer.address}.`,
{ error: true }
)
} else if (e && e.message.includes('0x6b0c')) {
} else if (e.message.includes('0x6b0c')) {
// not sure if that's actually the case with this hellish error, but after unlocking the device it no longer appeared
// however, it stopped appearing after that even if the device is locked, so I'm not sure it's related...
addToast(
Expand Down

0 comments on commit 00da4d1

Please sign in to comment.