From 2863e6c67f205af5a9ed4155ee57db5c3cadf996 Mon Sep 17 00:00:00 2001 From: lukelalo Date: Wed, 4 Sep 2024 14:07:10 +0200 Subject: [PATCH] Fix #6784 - Toast onRemove message (#7108) * Fixed toast onRemove message * Fixed Messages.js onRemove message --------- Co-authored-by: pablo.garcia.almis --- components/lib/messages/Messages.js | 2 +- components/lib/toast/Toast.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/messages/Messages.js b/components/lib/messages/Messages.js index 8d64f0fa92..5389526657 100644 --- a/components/lib/messages/Messages.js +++ b/components/lib/messages/Messages.js @@ -77,7 +77,7 @@ export const Messages = React.memo( setMessagesState((prev) => prev.filter((msg) => msg._pId !== messageInfo._pId && !ObjectUtils.deepEquals(msg.message, removeMessage))); - props.onRemove && props.onRemove(removeMessage.message || removeMessage); + props.onRemove && props.onRemove(messageInfo.message || removeMessage); }; const onClose = (messageInfo) => { diff --git a/components/lib/toast/Toast.js b/components/lib/toast/Toast.js index 53834183cf..ec3a5c1ccf 100644 --- a/components/lib/toast/Toast.js +++ b/components/lib/toast/Toast.js @@ -80,7 +80,7 @@ export const Toast = React.memo( setMessagesState((prev) => prev.filter((msg) => msg._pId !== messageInfo._pId && !ObjectUtils.deepEquals(msg.message, removeMessage))); - props.onRemove && props.onRemove(removeMessage.message || removeMessage); + props.onRemove && props.onRemove(messageInfo.message || removeMessage); }; const onClose = (messageInfo) => {