From f53b1bf670fe63b2d636397aa7b930f337552e57 Mon Sep 17 00:00:00 2001 From: asiaznik Date: Thu, 19 Jan 2023 12:44:58 +0100 Subject: [PATCH] fix: after rebase errors fix: lint --- apps/trading/lib/hooks/use-vega-transaction-toasts.tsx | 4 +++- libs/wallet/src/use-vega-transaction.tsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx b/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx index 8778317ea..32169978d 100644 --- a/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx +++ b/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx @@ -484,7 +484,9 @@ const VegaTxCompleteToastsContent = ({ tx }: VegaTxToastContentProps) => { const VegaTxErrorToastContent = ({ tx }: VegaTxToastContentProps) => { let label = t('Error occurred'); let errorMessage = `${tx.error?.message} ${ - tx.error?.data ? `: ${tx.error?.data}` : '' + tx.error instanceof WalletError && tx.error?.data + ? `: ${tx.error?.data}` + : '' }`; const reconnectVegaWallet = useReconnectVegaWallet(); diff --git a/libs/wallet/src/use-vega-transaction.tsx b/libs/wallet/src/use-vega-transaction.tsx index d786020a4..118962d93 100644 --- a/libs/wallet/src/use-vega-transaction.tsx +++ b/libs/wallet/src/use-vega-transaction.tsx @@ -7,6 +7,7 @@ import type { Intent } from '@vegaprotocol/ui-toolkit'; import type { Transaction } from './connectors'; import { ClientErrors } from './connectors'; import { WalletError } from './connectors'; +import type { WalletClientError } from '@vegaprotocol/wallet-client'; export interface DialogProps { intent?: Intent; @@ -25,7 +26,7 @@ export enum VegaTxStatus { export interface VegaTxState { status: VegaTxStatus; - error: WalletError | Error | null; + error: WalletError | WalletClientError | Error | null; txHash: string | null; signature: string | null; dialogOpen: boolean;