Update useSafeAppConnection.ts

This commit is contained in:
Georges KABBOUCHI 2021-09-06 19:47:55 +03:00
parent b00b101c6a
commit bd8a7f0e80

View File

@ -2,7 +2,7 @@ import { useWeb3 } from "@instadapp/vue-web3";
import { injected } from "../connectors";
import { onMounted, ref, watch } from "@nuxtjs/composition-api";
import { SafeAppConnector } from "@gnosis.pm/safe-apps-web3-react";
import { useNetwork } from "./useNetwork";
import { Network, useNetwork } from "./useNetwork";
export function useSafeAppConnection(connector?: SafeAppConnector) {
const { activate, active } = useWeb3();
@ -17,8 +17,7 @@ export function useSafeAppConnection(connector?: SafeAppConnector) {
tried.value = true;
});
//@ts-ignore
activeNetworkId.value = await connector.getChainId()
activeNetworkId.value = (await connector.getChainId() === 1) ? Network.Mainnet : Network.Polygon;
} else {
tried.value = true;
}