Skip to content

Commit

Permalink
fix: proposal Id store variable data type
Browse files Browse the repository at this point in the history
  • Loading branch information
0xExp-po committed Dec 17, 2024
1 parent abbd847 commit cd168ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dapp/src/components/page/proposal/VotingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { VoteType } from "types/proposal";

interface VotersModalProps {
projectName: string;
proposalId: number;
proposalId: number | undefined;
isVoted: boolean;
setIsVoted: React.Dispatch<React.SetStateAction<boolean>>;
onClose: () => void;
Expand Down Expand Up @@ -34,6 +34,10 @@ const VotingModal: React.FC<VotersModalProps> = ({

setIsLoading(true);
const { voteToProposal } = await import("@service/WriteContractService");
if (proposalId === undefined) {
alert("Proposal ID is required");
return;
}
const res = await voteToProposal(projectName, proposalId, selectedOption);

if (res.data) {
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/utils/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export const projectInfoLoaded = atom(false);
export const latestCommit = atom("");
export const projectCardModalOpen = atom(false);
export const projectNameForGovernance = atom("");
export const proposalId = atom(0);
export const proposalId = atom(undefined);
export const connectedPublicKey = atom("");

0 comments on commit cd168ea

Please sign in to comment.