Add block list

This commit is contained in:
HeesungB 2022-12-19 00:32:35 +09:00
parent 279a372052
commit 40e3522c2a

View File

@ -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<TwitterProfileType>();
@ -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;