Skip to content

Commit ce63962

Browse files
committed
fix(web): fix-shutter-commit-call
1 parent c6b51c1 commit ce63962

File tree

1 file changed

+8
-6
lines changed
  • web/src/pages/Cases/CaseDetails/Voting/Shutter

1 file changed

+8
-6
lines changed

web/src/pages/Cases/CaseDetails/Voting/Shutter/Commit.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,23 @@ const Commit: React.FC<ICommit> = ({
105105

106106
const commitHash = hashVote(choice, BigInt(salt), justification);
107107

108-
let request;
108+
let config;
109109
if (isGated) {
110-
request = await simulateDisputeKitGatedShutterCastCommitShutter(wagmiConfig, {
110+
config = await simulateDisputeKitGatedShutterCastCommitShutter(wagmiConfig, {
111111
args: [parsedDisputeID, parsedVoteIDs, commitHash, identity as `0x${string}`, encryptedCommitment],
112112
});
113113
} else {
114-
request = await simulateDisputeKitShutterCastCommitShutter(wagmiConfig, {
114+
config = await simulateDisputeKitShutterCastCommitShutter(wagmiConfig, {
115115
args: [parsedDisputeID, parsedVoteIDs, commitHash, identity as `0x${string}`, encryptedCommitment],
116116
});
117117
}
118118

119119
if (walletClient && publicClient) {
120-
await wrapWithToast(async () => await walletClient.writeContract(request), publicClient).then(({ status }) => {
121-
setIsOpen(status);
122-
});
120+
await wrapWithToast(async () => await walletClient.writeContract(config.request), publicClient).then(
121+
({ status }) => {
122+
setIsOpen(status);
123+
}
124+
);
123125
}
124126
refetch();
125127
},

0 commit comments

Comments
 (0)