Skip to content

Commit

Permalink
fix(ballot-rejected): fixed error message and scrollbar in overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Crisgarner committed Dec 16, 2024
1 parent 6b4ad88 commit 98a26f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions packages/interface/src/contexts/Maci.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,17 @@ export const MaciProvider: React.FC<MaciProviderProps> = ({ children }: MaciProv
signer,
})
.then(() => onSuccess())
.catch((err: Error) => {
setError(err.message);
return onError(err.message);
.catch((err: unknown) => {
if ((err as { code: string }).code === "ACTION_REJECTED") {
setError("Transaction rejected");
return onError("Transaction rejected");
}
if (err instanceof Error) {
setError(err.message);
return onError(err.message);
}
setError(String(err));
return onError(String(err));
})
.finally(() => {
setIsLoading(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const RoundItem = ({ round }: IRoundItemProps): JSX.Element => {
{round.roundId}
</Heading>

<div className="my-4 h-16 overflow-scroll text-gray-400">{round.description}</div>
<div className="my-4 h-16 overflow-hidden text-gray-400">{round.description}</div>

<RoundTag state={roundState} />
</div>
Expand Down

0 comments on commit 98a26f0

Please sign in to comment.