Skip to content

Commit

Permalink
Flash messages bug fixes
Browse files Browse the repository at this point in the history
 * Fixed bugs in flash messages using reactive state
  • Loading branch information
ErikDakoda committed Feb 3, 2021
1 parent 5f526b7 commit f330b1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/vulcan-core/lib/modules/containers/withMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export const useMessages = (intl) => {

flash: (message) => {
message = normalizeMessage(message, intl);
messagesState({ messages: { $push: [message] } });
messagesState(state => {
state.messages.push(message);
return state;
});
},

dismissFlash: (_id) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/vulcan-ui-material/lib/components/core/Flash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const Flash = (props, context) => {
]}
>
<Alert onClose={handleClose}
severity={type}
severity={infoOrError}
variant="filled"
classes={{
root: classes.alert,
Expand Down

0 comments on commit f330b1b

Please sign in to comment.