Skip to content

Commit

Permalink
Fix polling error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
OKendigelyan committed Sep 18, 2024
1 parent 5d1e423 commit 90be62a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions packages/data-polling/src/useReactQueryErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@ import { useCallback } from "react";
export const useReactQueryErrorHandler = () => {
const dispatch = useAppDispatch();
const toast = useToast();
const toastId = "data-fetching-error";

return useCallback(
(error: any) => {
if (!error) {
return;
}
dispatch(errorsActions.add(getErrorContext(error)));
toast({
id: "data-fetching-error",
description: `Data fetching error: ${error.message}`,
status: "error",
isClosable: true,
duration: 10000,
});

if (!toast.isActive(toastId)) {
toast({
id: toastId,
description: `Data fetching error: ${error.message}`,
status: "error",
isClosable: true,
duration: 10000,
});
}
console.error(error);
},
[dispatch, toast]
);
Expand Down
2 changes: 1 addition & 1 deletion packages/multisig/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const parseMultisigOperation = (raw: RawTzktMultisigBigMap): MultisigOperation =
bigmapId: bigmap,
rawActions: value.actions,
// For now, we assume the approver is always an implicit account
approvals: value.approvals.map(parseImplicitPkh),
approvals: value.approvals?.map(parseImplicitPkh) ?? [],
};
};

Expand Down

0 comments on commit 90be62a

Please sign in to comment.