From a1d3a28ea5568b4e6c0239c85e6a39d3606a30a4 Mon Sep 17 00:00:00 2001 From: ceriddenn Date: Sun, 26 Mar 2023 02:08:06 -0400 Subject: [PATCH 1/2] disable turnstile stuff for now --- apps/web/pages/submissions/review.tsx | 33 ++++++++++---------- apps/web/pages/submissions/upload.tsx | 8 ++--- apps/web/server/trpc/router/gameplay.ts | 40 ++++++++++++------------- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/apps/web/pages/submissions/review.tsx b/apps/web/pages/submissions/review.tsx index cd8f5c46..a02cc2f4 100644 --- a/apps/web/pages/submissions/review.tsx +++ b/apps/web/pages/submissions/review.tsx @@ -74,18 +74,18 @@ export default function Review() { setLoading(true); - if (!isRequestValid) { - toast({ - position: 'bottom-right', - title: 'Invalid Request', - description: - 'Your request was deemed invalid. Please reload the page or try again.', - status: 'error', - duration: 5000, - isClosable: true, - }); - return; - } + // if (!isRequestValid) { + // toast({ + // position: 'bottom-right', + // title: 'Invalid Request', + // description: + // 'Your request was deemed invalid. Please reload the page or try again.', + // status: 'error', + // duration: 5000, + // isClosable: true, + // }); + // return; + // } const review = action === 'yes'; await reviewGameplay.mutateAsync({ @@ -109,10 +109,11 @@ export default function Review() { useEffect(() => { const getNecessaryData = async () => { - if (tsToken && tsToken.length > 3 && !reviewItemData) { - await refetch(); - return; - } + // if (tsToken && tsToken.length > 3 && !reviewItemData) { + // await refetch(); + // return; + // } + await refetch(); setReviewItem(reviewItemData); if (error?.data?.code == 'NOT_FOUND') { setFinished(true); diff --git a/apps/web/pages/submissions/upload.tsx b/apps/web/pages/submissions/upload.tsx index d8dfa6f7..3f12d9ff 100644 --- a/apps/web/pages/submissions/upload.tsx +++ b/apps/web/pages/submissions/upload.tsx @@ -146,10 +146,10 @@ export default function Upload() { }; const handleClipUpload = async () => { - if (!isRequestValid) { - handleRequestError('Request Invalid. Reload and try again.'); - return; - } + // if (!isRequestValid) { + // handleRequestError('Request Invalid. Reload and try again.'); + // return; + // } if (requestDone) { setSelectedGame(''); setCurrentUrl(''); diff --git a/apps/web/server/trpc/router/gameplay.ts b/apps/web/server/trpc/router/gameplay.ts index 86d6a552..31835306 100644 --- a/apps/web/server/trpc/router/gameplay.ts +++ b/apps/web/server/trpc/router/gameplay.ts @@ -151,16 +151,16 @@ export const gameplayRouter = router({ ) .output(GameplaySchema) .mutation(async ({ input, ctx }) => { - const isPerson = await vUser(input.tsToken); - if (!isPerson) { - throw new TRPCError({ - code: 'BAD_REQUEST', - message: - 'We could not confirm if you were a legitimate user. Please refresh the page and try again.', - // not sure if its safe to give this to the user - cause: '', - }); - } + // const isPerson = await vUser(input.tsToken); + // if (!isPerson) { + // throw new TRPCError({ + // code: 'BAD_REQUEST', + // message: + // 'We could not confirm if you were a legitimate user. Please refresh the page and try again.', + // // not sure if its safe to give this to the user + // cause: '', + // }); + // } const existingGameplay = await ctx.prisma.gameplay.findUnique({ where: { youtubeUrl: input.youtubeUrl, @@ -449,16 +449,16 @@ export const gameplayRouter = router({ ) .output(ReviewItemsGameplaySchema) .query(async ({ input, ctx }) => { - const isPerson = await vUser(input.tsToken); - if (!isPerson) { - throw new TRPCError({ - code: 'BAD_REQUEST', - message: - 'We could not confirm if you were a legitimate user. Please refresh the page and try again.', - // not sure if its safe to give this to the user - cause: '', - }); - } + // const isPerson = await vUser(input.tsToken); + // if (!isPerson) { + // throw new TRPCError({ + // code: 'BAD_REQUEST', + // message: + // 'We could not confirm if you were a legitimate user. Please refresh the page and try again.', + // // not sure if its safe to give this to the user + // cause: '', + // }); + // } const randomPick = (values: string[]) => { const index = Math.floor(Math.random() * values.length); return values[index]; From 32ba42a77c0925876e21a95edeaaf4a2e91bbd00 Mon Sep 17 00:00:00 2001 From: ceriddenn Date: Sun, 26 Mar 2023 02:12:09 -0400 Subject: [PATCH 2/2] update lint issues --- apps/web/pages/api/auth/[...nextauth].ts | 1 - apps/web/pages/submissions/review.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/apps/web/pages/api/auth/[...nextauth].ts b/apps/web/pages/api/auth/[...nextauth].ts index 0d9f1fa6..cc792c58 100644 --- a/apps/web/pages/api/auth/[...nextauth].ts +++ b/apps/web/pages/api/auth/[...nextauth].ts @@ -9,7 +9,6 @@ import { prisma } from '@server/db/client'; import NextAuth from 'next-auth/next'; import { Profile, Session, User } from 'next-auth'; import { Roles } from 'database'; -import { signIn } from 'next-auth/react'; import { Account } from 'next-auth'; const RicanGHId = '59850372'; diff --git a/apps/web/pages/submissions/review.tsx b/apps/web/pages/submissions/review.tsx index a02cc2f4..a470d5ad 100644 --- a/apps/web/pages/submissions/review.tsx +++ b/apps/web/pages/submissions/review.tsx @@ -9,7 +9,6 @@ import { } from '@chakra-ui/react'; import { useState, useEffect, ReactElement } from 'react'; import { useRouter } from 'next/router'; -import Loading from '@components/Loading'; import Layout from '@components/Layout'; import { trpc } from '@utils/trpc'; import Head from 'next/head';