Skip to content

Commit

Permalink
feat: add stake check before submit
Browse files Browse the repository at this point in the history
  • Loading branch information
EdSDR committed Oct 15, 2024
1 parent fcc3392 commit a1e0353
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/commune-validator/src/app/components/delegated-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { usePathname, useRouter } from "next/navigation";
import { ChevronUpIcon, XMarkIcon } from "@heroicons/react/24/outline";

import { useCommune } from "@commune-ts/providers/use-commune";
import { toast } from "@commune-ts/providers/use-toast";
import {
Button,
Card,
Expand Down Expand Up @@ -205,6 +206,15 @@ export function DelegatedList() {

const handleSubmit = async () => {
if (!selectedAccount?.address || totalPercentage !== 100) {
toast.error(
"Please connect your wallet and ensure total percentage is 100%",
);
return;
}
if (Number(userStakeWeight) <= 50) {
toast.error(
"You must have at least 50 COMAI staked to delegate modules or subnets",
);
return;
}
setIsSubmitting(true);
Expand Down

0 comments on commit a1e0353

Please sign in to comment.