Skip to content

Commit

Permalink
fix(rwa): small bug in messaging (#2806)
Browse files Browse the repository at this point in the history
  • Loading branch information
sstraatemans authored Jan 20, 2025
1 parent 1280df7 commit f2093a5
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const interpretErrorMessage = (
return interpretMessage(result);
}

return interpretMessage(result.result.error?.message!, data);
return interpretMessage(result?.result?.error?.message!, data);
};

export const TransactionsProvider: FC<PropsWithChildren> = ({ children }) => {
Expand All @@ -133,23 +133,6 @@ export const TransactionsProvider: FC<PropsWithChildren> = ({ children }) => {

r.subscribe(
(nextData: any) => {
if (!nextData.data.transaction) {
addNotification({
intent: 'negative',
label: 'there was an error',
message: interpretErrorMessage(
nextData?.errors
? JSON.stringify(nextData?.errors)
: JSON.parse(
nextData?.data.transaction?.result?.badResult ?? '{}',
).message,
),
url: `https://explorer.kadena.io/${activeNetwork.networkId}/transaction/${data.requestKey}`,
});

// eslint-disable-next-line @typescript-eslint/no-floating-promises
store.removeTransaction(data);
}
if (
nextData?.errors?.length !== undefined ||
nextData?.data?.transaction?.result.badResult
Expand Down

0 comments on commit f2093a5

Please sign in to comment.