Skip to content

Commit

Permalink
prompt elastos switch
Browse files Browse the repository at this point in the history
racollette committed Jun 24, 2024
1 parent 673463b commit 2cebe33
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import { useTranslation } from 'contexts/Localization'
const useAuth = () => {
const { t } = useTranslation()
const dispatch = useAppDispatch()
const { activate, deactivate } = useWeb3React()
const { activate, deactivate, library } = useWeb3React()
const { toastError } = useToast()

const login = useCallback(
@@ -48,15 +48,16 @@ const useAuth = () => {
toastError(t('Authorization Error'), t('Please authorize to access your account'))
} else {
// toastError(error.name, error.message)
toastError(t('Network Error'), t('Please connect to the correct network'))
toastError(t('Network Error'), t('Prompting switching to Elastos. Please try again.'))
setupNetwork(20, library)
}
}
})
} else {
toastError(t('Unable to find connector'), t('The connector config is wrong'))
}
},
[t, activate, toastError],
[t, activate, toastError, library],
)

const logout = useCallback(() => {

0 comments on commit 2cebe33

Please sign in to comment.