From 40e3522c2a4c9f5b289458399ee94caa5a2d478a Mon Sep 17 00:00:00 2001 From: HeesungB Date: Mon, 19 Dec 2022 00:32:35 +0900 Subject: [PATCH] Add block list --- pages/verification/index.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pages/verification/index.tsx b/pages/verification/index.tsx index b2f6048..252975c 100644 --- a/pages/verification/index.tsx +++ b/pages/verification/index.tsx @@ -50,7 +50,6 @@ import { queryRegisteredTwitterId, verifyTwitterAccount, } from "../../queries"; -import { ErrorHandler } from "../../utils/error"; import { KEPLR_NOT_FOUND_ERROR, TWITTER_LOGIN_ERROR, @@ -60,8 +59,9 @@ import Axios from "axios"; import { BackButton } from "../../components/back-button"; import { FinalCheckModal } from "../../components/final-check-modal"; import { ErrorModal } from "../../components/error-modal"; +import * as process from "process"; -export default function VerificationPage() { +export default function VerificationPage(props: { blockList: string[] }) { const router = useRouter(); const [twitterAuthInfo, setTwitterAuthInfo] = useState(); @@ -263,6 +263,10 @@ export default function VerificationPage() { const chainArray = []; for (let i = 0; i < chainKeys.length; i++) { + if (props.blockList.includes(chainInfos[i].prefix)) { + continue; + } + const chainKey = chainKeys[i]; if (chainKey.status !== "fulfilled") { console.log("Failed to get key from wallet", chainKey); @@ -518,6 +522,15 @@ export default function VerificationPage() { ); } +export async function getStaticProps() { + let blockList: string[] = []; + if (process.env.BLOCK_LIST) { + blockList = process.env.BLOCK_LIST.trim().split(","); + } + + return { props: { blockList } }; +} + const Container = styled.div` width: 100vw; height: 100vh;