Commit a880d7b8 authored by tom goriunov's avatar tom goriunov Committed by GitHub

`Unrecognized chain ID` error when adding network via mobile MetaMask (#2312)

Fixes #2267
parent 49bfadeb
import _get from 'lodash/get';
import React from 'react';
import config from 'configs/app';
......@@ -24,9 +25,10 @@ export default function useAddOrSwitchChain() {
const errorObj = getErrorObj(error);
const code = errorObj && 'code' in errorObj ? errorObj.code : undefined;
const originalErrorCode = _get(errorObj, 'data.originalError.code');
// This error code indicates that the chain has not been added to Wallet.
if (code === 4902) {
if (code === 4902 || originalErrorCode === 4902) {
const params = [ {
chainId: hexadecimalChainId,
chainName: config.chain.name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment