Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/app/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ const CreatePage: React.FC = () => {
const [endTime, setEndTime] = useState<Date | null>(new Date());
const [candidates,setCandidates] = useState<Candidate[]>([])
const changeChain = () => {
// TRAINER FIX: Check if a Wallet is actually installed first!
if (typeof window !== "undefined" && !(window as any).ethereum) {
toast.error("No Crypto Wallet Found!");
alert("Please install MetaMask to continue.");
window.open("https://metamask.io/download/", "_blank");
return;
}

// If wallet exists, proceed with the switch
switchChain({ chainId: sepolia.id });
}
interface Candidate {
Expand Down
Loading