From 2f6800212ec4f7b9f2d1ad3bb38fb3455c888bd5 Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Thu, 13 Apr 2023 16:20:28 -0400 Subject: [PATCH] fix(trading): fix order toast intent on amendments (#3433) --- apps/trading/lib/hooks/use-vega-transaction-toasts.spec.tsx | 2 +- apps/trading/lib/hooks/use-vega-transaction-toasts.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/trading/lib/hooks/use-vega-transaction-toasts.spec.tsx b/apps/trading/lib/hooks/use-vega-transaction-toasts.spec.tsx index 10cd72f40..7902f5596 100644 --- a/apps/trading/lib/hooks/use-vega-transaction-toasts.spec.tsx +++ b/apps/trading/lib/hooks/use-vega-transaction-toasts.spec.tsx @@ -292,7 +292,7 @@ describe('getVegaTransactionContentIntent', () => { Intent.Success ); expect(getVegaTransactionContentIntent(editOrder).intent).toBe( - Intent.Success + Intent.Primary ); expect(getVegaTransactionContentIntent(cancelOrder).intent).toBe( Intent.Primary diff --git a/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx b/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx index 86a70d6c6..36793dd30 100644 --- a/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx +++ b/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx @@ -681,6 +681,9 @@ export const getVegaTransactionContentIntent = (tx: VegaStoredTxState) => { // Transaction can be successful but the order can be rejected by the network const intent = - (tx.order && getOrderToastIntent(tx.order.status)) || intentMap[tx.status]; + (tx.order && + !isOrderAmendmentTransaction(tx.body) && + getOrderToastIntent(tx.order.status)) || + intentMap[tx.status]; return { intent, content }; };