diff --git a/packages/data-polling/.eslintrc.cjs b/packages/data-polling/.eslintrc.cjs index cf87fd8485..af08845d60 100644 --- a/packages/data-polling/.eslintrc.cjs +++ b/packages/data-polling/.eslintrc.cjs @@ -6,5 +6,12 @@ module.exports = { parser: "@typescript-eslint/parser", tsconfigRootDir: __dirname, }, - overrides: [{ files: ["src/index.ts"], rules: { "import/no-unused-modules": "off" } }], + overrides: [ + { + files: ["*.ts", "*.tsx"], + rules: { + "import/no-unused-modules": "off", + }, + }, + ], }; diff --git a/packages/data-polling/src/useDataPolling.ts b/packages/data-polling/src/useDataPolling.ts index 94e3064615..6ae92711ed 100644 --- a/packages/data-polling/src/useDataPolling.ts +++ b/packages/data-polling/src/useDataPolling.ts @@ -1,6 +1,6 @@ import { assetsActions, useAppDispatch } from "@umami/state"; import { fromUnixTime } from "date-fns"; -import { max } from "lodash"; +import max from "lodash/max"; import { useEffect } from "react"; import { usePollAccountStates } from "./usePollAccountStates"; diff --git a/packages/data-polling/src/useReactQueryErrorHandler.ts b/packages/data-polling/src/useReactQueryErrorHandler.ts index 94d5948484..75711227c0 100644 --- a/packages/data-polling/src/useReactQueryErrorHandler.ts +++ b/packages/data-polling/src/useReactQueryErrorHandler.ts @@ -6,6 +6,7 @@ import { useCallback } from "react"; export const useReactQueryErrorHandler = () => { const dispatch = useAppDispatch(); const toast = useToast(); + const toastId = "data-fetching-error"; return useCallback( (error: any) => { @@ -13,13 +14,17 @@ export const useReactQueryErrorHandler = () => { 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] ); diff --git a/packages/multisig/.eslintrc.cjs b/packages/multisig/.eslintrc.cjs index effe41d41f..af08845d60 100644 --- a/packages/multisig/.eslintrc.cjs +++ b/packages/multisig/.eslintrc.cjs @@ -6,4 +6,12 @@ module.exports = { parser: "@typescript-eslint/parser", tsconfigRootDir: __dirname, }, + overrides: [ + { + files: ["*.ts", "*.tsx"], + rules: { + "import/no-unused-modules": "off", + }, + }, + ], }; diff --git a/packages/multisig/src/helpers.ts b/packages/multisig/src/helpers.ts index e5c8402b22..afd4a7a3db 100644 --- a/packages/multisig/src/helpers.ts +++ b/packages/multisig/src/helpers.ts @@ -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) ?? [], }; }; diff --git a/packages/multisig/src/types.ts b/packages/multisig/src/types.ts index 2b6c99f1c4..87a6798ecf 100644 --- a/packages/multisig/src/types.ts +++ b/packages/multisig/src/types.ts @@ -32,6 +32,6 @@ export type RawTzktMultisigBigMap = { key: string | null; value: { actions: string; - approvals: string[]; + approvals?: string[]; } | null; };