Skip to content

Commit

Permalink
Merge pull request #316 from paritytech/ki-dispatch-error-fix
Browse files Browse the repository at this point in the history
Override DispatchError type error field
  • Loading branch information
kwingram25 authored Jun 6, 2022
2 parents 0a1d9ac + f007be2 commit 9ca5b1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 9 additions & 1 deletion src/api/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ export const connect = (endpoint: string, dispatch: React.Dispatch<ApiAction>) =
dispatch({ type: 'CONNECT_INIT' });

const provider = new WsProvider(endpoint);
const _api = new ApiPromise({ provider });
const _api = new ApiPromise({
provider,
types: {
DispatchErrorModule: {
index: 'u8',
error: '[u8; 4]',
},
},
});

// Set listeners for disconnection and reconnection event.
_api.on('connected', async () => {
Expand Down
6 changes: 1 addition & 5 deletions src/ui/components/Transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ export function Transactions({
);
})}
</div>
<XIcon
className="text-gray-400 w-4 h-4"
data-cy="dismiss-notification"
onClick={() => dismiss(parseInt(id))}
/>
<XIcon className="text-gray-400 w-4 h-4" onClick={() => dismiss(parseInt(id))} />
</div>
)}
</>
Expand Down

0 comments on commit 9ca5b1f

Please sign in to comment.