Skip to content

Commit

Permalink
fix network detection
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed Jun 13, 2023
1 parent 434cedb commit 5a4cc61
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/provider/modules/custom-sbts/custom-sbts.ts
Expand Up @@ -4,6 +4,7 @@ import { Signer } from 'ethers';
import { useQuery } from 'react-query';
import { useLocalStorage } from '../../use-local-storage';
import { queryClient } from '../../masa-query-client';
import { CustomGallerySBT } from 'components/masa-interface/pages/gallery/gallery';

function getLocalStorageRecordsByPrefix(
prefix: string
Expand Down Expand Up @@ -39,15 +40,17 @@ export const useSavedSbts = (masa, prefix): { savedContracts: any[] } => {
return { savedContracts };
};

const fetchContracts = async (masa, customGallerySBT) => {
const fetchContracts = async (
masa: Masa,
customGallerySBT: CustomGallerySBT[]
) => {
if (customGallerySBT && customGallerySBT.length > 0) {
const newContracts: any[] = [];
for (const sbt of customGallerySBT) {
if (sbt.networks) {
if (sbt.network !== masa.config.networkName) {
continue;
}
if (sbt.network && sbt.network !== masa.config.networkName) {
continue;
}

try {
const sbtContract = await masa?.sbt.connect(sbt.address);

Expand Down

0 comments on commit 5a4cc61

Please sign in to comment.