Skip to content

Commit

Permalink
Fix #6456 : Toast close by id fix (#6457)
Browse files Browse the repository at this point in the history
* Fix #6456

* Fix #6456 update

* Fix #6456 update

* Fix #6456 messages fix
  • Loading branch information
Rekl0w authored Apr 24, 2024
1 parent 716039b commit c35496f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/lib/messages/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const Messages = React.memo(

const remove = (messageInfo) => {
// allow removal by ID or by message equality
const removeMessage = messageInfo._pId ? messageInfo.message : messageInfo;
const removeMessage = messageInfo._pId ? messageInfo._pId : messageInfo.message || messageInfo;

setMessagesState((prev) => prev.filter((msg) => msg._pId !== messageInfo._pId && !ObjectUtils.deepEquals(msg.message, removeMessage)));

Expand Down
2 changes: 1 addition & 1 deletion components/lib/toast/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const Toast = React.memo(

const remove = (messageInfo) => {
// allow removal by ID or by message equality
const removeMessage = messageInfo._pId ? messageInfo.message : messageInfo;
const removeMessage = messageInfo._pId ? messageInfo._pId : messageInfo.message || messageInfo;

setMessagesState((prev) => prev.filter((msg) => msg._pId !== messageInfo._pId && !ObjectUtils.deepEquals(msg.message, removeMessage)));

Expand Down

0 comments on commit c35496f

Please sign in to comment.