diff --git a/mpc-core-kit-web/mpc-react-playground/src/pages/HomePage.tsx b/mpc-core-kit-web/mpc-react-playground/src/pages/HomePage.tsx index be55b781..86b69ebb 100644 --- a/mpc-core-kit-web/mpc-react-playground/src/pages/HomePage.tsx +++ b/mpc-core-kit-web/mpc-react-playground/src/pages/HomePage.tsx @@ -1,7 +1,6 @@ import { COREKIT_STATUS } from "@web3auth/mpc-core-kit"; import React, { useEffect } from "react"; -// import { useNavigate } from "react-router-dom"; import Console from "../components/Console"; import Header from "../components/Header"; // import ShareDescriptionComponent from "../components/ShareDescription"; @@ -9,29 +8,27 @@ import Sidebar from "../components/Sidebar"; import { useMPCCoreKit } from "../services/mpcCoreKit"; function HomePage() { - const { coreKitStatus, provider, keyDetails } = useMPCCoreKit(); - // const navigate = useNavigate(); - - - + const { coreKitStatus, keyDetails } = useMPCCoreKit(); useEffect(() => { + console.log("coreKitStatus", coreKitStatus); if (coreKitStatus === COREKIT_STATUS.REQUIRED_SHARE) { - // navigate("/recover"); + console.log("require more share"); + // Redirect to "/recover" when REQUIRED_SHARE + window.location.href = "/recover"; } - }, []); + }, [coreKitStatus]); return (
- {provider ? ( + {coreKitStatus === COREKIT_STATUS.LOGGED_IN ? (

Welcome to Web3Auth MPC Core Kit Playground

-