fix: format error labels

This commit is contained in:
Madalina Raicu 2022-08-15 22:40:55 +01:00
parent e265a14e69
commit 9c93793a93

View File

@ -1,5 +1,5 @@
import { useEnvironment } from '@vegaprotocol/environment';
import { t } from '@vegaprotocol/react-helpers';
import { formatLabel, t } from '@vegaprotocol/react-helpers';
import { Toast, Icon, Intent, Loader } from '@vegaprotocol/ui-toolkit';
import type { ReactNode } from 'react';
import type { VegaTxState } from '../use-vega-transaction';
@ -72,7 +72,7 @@ export const VegaDialog = ({ transaction }: VegaDialogProps) => {
if (transaction.status === VegaTxStatus.Error) {
return (
<div data-testid={transaction.status}>
<p>{transaction.error}</p>
<p>{transaction.error && formatLabel(transaction.error)}</p>
</div>
);
}