From 98a26f0f7799689a7f4255aae50fcb4d07b7d7b7 Mon Sep 17 00:00:00 2001 From: Crisgarner <@crisgarner> Date: Sun, 15 Dec 2024 19:40:19 -0600 Subject: [PATCH] fix(ballot-rejected): fixed error message and scrollbar in overflow --- packages/interface/src/contexts/Maci.tsx | 14 +++++++++++--- .../src/features/rounds/components/RoundItem.tsx | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/interface/src/contexts/Maci.tsx b/packages/interface/src/contexts/Maci.tsx index b38857f8..a902997a 100644 --- a/packages/interface/src/contexts/Maci.tsx +++ b/packages/interface/src/contexts/Maci.tsx @@ -310,9 +310,17 @@ export const MaciProvider: React.FC = ({ 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); diff --git a/packages/interface/src/features/rounds/components/RoundItem.tsx b/packages/interface/src/features/rounds/components/RoundItem.tsx index d9cac9cb..5f232857 100644 --- a/packages/interface/src/features/rounds/components/RoundItem.tsx +++ b/packages/interface/src/features/rounds/components/RoundItem.tsx @@ -72,7 +72,7 @@ export const RoundItem = ({ round }: IRoundItemProps): JSX.Element => { {round.roundId} -
{round.description}
+
{round.description}