mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
fix: consolidated console logs + eslint fix
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-console": [
|
||||
"error",
|
||||
{
|
||||
"allow": ["error"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["./graphql/**/*.ts", "./lib/hooks.ts"],
|
||||
|
||||
@@ -20,11 +20,12 @@ export const Listen: React.FC = () => {
|
||||
|
||||
const { data, error } = useSWR(podcastRSSURL, parse);
|
||||
|
||||
if (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Podcast fetch error: ', error);
|
||||
setLoading(false);
|
||||
}
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
console.error('Podcast fetch error', error);
|
||||
setLoading(false);
|
||||
}
|
||||
}, [error]);
|
||||
|
||||
useEffect(() => {
|
||||
if (data) {
|
||||
|
||||
@@ -101,8 +101,7 @@ export const Seed = (): ReactElement => {
|
||||
|
||||
return setToken(tokenData);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('getTokenData: ', error);
|
||||
console.error('error fetching tokenData', error);
|
||||
return null;
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -78,13 +78,11 @@ export const Chiev = ({
|
||||
const handleMinting = useCallback(async () => {
|
||||
try {
|
||||
setClaiming(true);
|
||||
const tx = await mintChiev(chievId);
|
||||
if (tx) {
|
||||
console.log('receipt', tx);
|
||||
}
|
||||
setClaiming(false);
|
||||
await mintChiev(chievId);
|
||||
} catch (error) {
|
||||
console.error('handleMintingError', error);
|
||||
} finally {
|
||||
setClaiming(false);
|
||||
}
|
||||
}, [mintChiev]);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { Maybe } from '@metafam/utils';
|
||||
import { Web3ContextType } from 'contexts/Web3Context';
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ export const OnboardingGame: React.FC = (): JSX.Element => {
|
||||
currentChoices: [],
|
||||
};
|
||||
} catch (error) {
|
||||
console.log('makeCurrentSectionDialogue error', { error });
|
||||
console.error('makeCurrentSectionDialogue error', error);
|
||||
return {
|
||||
currentDialogue: [],
|
||||
currentChoices: [],
|
||||
@@ -217,7 +217,6 @@ export const OnboardingGame: React.FC = (): JSX.Element => {
|
||||
throw new Error('No connections found');
|
||||
} catch (error) {
|
||||
setCurrentConnections([]);
|
||||
// console.log('getConnections ', { error });
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
@@ -247,7 +246,6 @@ export const OnboardingGame: React.FC = (): JSX.Element => {
|
||||
}
|
||||
throw new Error('No jumpers found');
|
||||
} catch (error) {
|
||||
// console.log('getJumpers ', { error });
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
@@ -376,8 +374,6 @@ export const OnboardingGame: React.FC = (): JSX.Element => {
|
||||
? { ...gameDataState?.elements[data], elementId: data }
|
||||
: undefined;
|
||||
if (nextElement !== undefined) {
|
||||
// console.log('NewElement', nextElement);
|
||||
|
||||
setCurrentElement(nextElement);
|
||||
makeCurrentSectionDialogue(nextElement);
|
||||
visitedElements(true);
|
||||
@@ -385,7 +381,7 @@ export const OnboardingGame: React.FC = (): JSX.Element => {
|
||||
setIsLoading(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('handleProgress error: ', { err });
|
||||
console.error('handleProgress error', err);
|
||||
setIsLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -29,9 +29,10 @@ const MeetWithWalletProfileEdition: React.FC<MeetWithWalletProps> = ({
|
||||
|
||||
const { provider } = useWeb3();
|
||||
|
||||
const address = useMemo(() => player?.ethereumAddress, [
|
||||
player?.ethereumAddress,
|
||||
]);
|
||||
const address = useMemo(
|
||||
() => player?.ethereumAddress,
|
||||
[player?.ethereumAddress],
|
||||
);
|
||||
|
||||
let information: JSX.Element;
|
||||
let buttonCopy: string;
|
||||
@@ -66,7 +67,6 @@ const MeetWithWalletProfileEdition: React.FC<MeetWithWalletProps> = ({
|
||||
setCalendarUrl(result.calendar_url);
|
||||
}
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Failed to verify Meet with wallet account', e);
|
||||
}
|
||||
setLoading(false);
|
||||
@@ -110,7 +110,6 @@ const MeetWithWalletProfileEdition: React.FC<MeetWithWalletProps> = ({
|
||||
).json()
|
||||
).calendar_url;
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Meet with wallet account creation failed', e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ export const PlayerCompletedQuests: React.FC<Props> = ({
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Couldn't fetch quests", error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -43,8 +43,7 @@ export const EmbeddedUrl: React.FC<EmbeddedUrlProps> = ({
|
||||
|
||||
setMetadata(response.og as unknown as URIMetadata);
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`No metadata found for the URL: ${uri}.`, err);
|
||||
console.error(`No metadata found for the URL "${uri}"`, err);
|
||||
setMetadata(null);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
@@ -97,8 +97,6 @@ export const WizardPane = <T,>({
|
||||
setValue(field, existing);
|
||||
}, [existing, field, setValue]);
|
||||
|
||||
console.log({ status });
|
||||
|
||||
const onSubmit = useCallback(
|
||||
async (values) => {
|
||||
try {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { Text, useToast, VStack } from '@metafam/ds';
|
||||
import { httpLink } from '@metafam/utils';
|
||||
import type {
|
||||
@@ -117,8 +118,8 @@ export const GameContextProvider: React.FC = ({ children }) => {
|
||||
}
|
||||
throw new Error('Game progression failed');
|
||||
} catch (error) {
|
||||
// add toast here
|
||||
console.log(error);
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(error);
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
@@ -158,6 +159,7 @@ export const GameContextProvider: React.FC = ({ children }) => {
|
||||
try {
|
||||
if (address === undefined) await connect();
|
||||
if (provider == null) throw new Error('Provider not set.');
|
||||
setTxLoading(true);
|
||||
|
||||
const token = new Contract(
|
||||
chievContractAddress,
|
||||
@@ -175,7 +177,7 @@ export const GameContextProvider: React.FC = ({ children }) => {
|
||||
status: 'info',
|
||||
isClosable: true,
|
||||
});
|
||||
const response = await fetch(httpLink(metadataURI)!);
|
||||
const response = await fetch(httpLink(metadataURI) ?? '');
|
||||
const metadata = await response.json();
|
||||
const tx = await token['mint(address[],uint256,bytes)'](
|
||||
[address],
|
||||
@@ -227,11 +229,11 @@ export const GameContextProvider: React.FC = ({ children }) => {
|
||||
isClosable: true,
|
||||
duration: 5000,
|
||||
});
|
||||
setTxLoading(false);
|
||||
|
||||
return receipt;
|
||||
} catch (error: any) {
|
||||
console.log('mintChiev error', { error });
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('mintChiev error', { error });
|
||||
const msg = (error?.reason as string) || 'unknown error';
|
||||
toast({
|
||||
title: 'Claim failed',
|
||||
@@ -241,6 +243,8 @@ export const GameContextProvider: React.FC = ({ children }) => {
|
||||
duration: 5000,
|
||||
});
|
||||
return msg;
|
||||
} finally {
|
||||
setTxLoading(false);
|
||||
}
|
||||
},
|
||||
[address, connect, provider, toast],
|
||||
|
||||
@@ -68,8 +68,7 @@ const fetchOpenSeaData = async (
|
||||
const body = await res.text();
|
||||
const { assets, error } = JSON.parse(body);
|
||||
if (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error({ error, body });
|
||||
console.error('error parsing opensea response', error);
|
||||
throw new Error(error);
|
||||
}
|
||||
if (!assets) throw new Error(`Received ${assets} assets`);
|
||||
|
||||
@@ -28,7 +28,7 @@ export const useBoxHeights = (items: Array<Maybe<HTMLElement>>) => {
|
||||
observer.observe(target);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing:`, target, key);
|
||||
console.warn(`Invalid box data, missing:`, target, key);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import {
|
||||
BasicProfile,
|
||||
model as basicProfileModel,
|
||||
@@ -73,7 +72,6 @@ export const useSaveCeramicProfile = ({
|
||||
values?: HasuraStringProps & HasuraEPObjects;
|
||||
images?: HasuraImageSourcedProps;
|
||||
}) => {
|
||||
console.log('here');
|
||||
if (!ceramic) {
|
||||
throw new CeramicError(
|
||||
'Unable to connect to the Ceramic API to save changes.',
|
||||
|
||||
@@ -35,9 +35,9 @@ export const useUser = ({
|
||||
);
|
||||
|
||||
if (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`useUser Error: ${error.message}`);
|
||||
console.error('useUser error', error);
|
||||
}
|
||||
|
||||
if (!authToken && connected) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('`authToken` unset when connected');
|
||||
|
||||
@@ -58,7 +58,7 @@ export const handler: (
|
||||
|
||||
res.status(201).json(uploadedFiles);
|
||||
} catch (err) {
|
||||
console.error(err); // eslint-disable-line no-console
|
||||
console.error('error uploading to web3.storage', err);
|
||||
res.status(500).json({ error: (err as Error).message });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user