Skip to content

Commit

Permalink
[FIX] Notification component not disappear
Browse files Browse the repository at this point in the history
  • Loading branch information
wbojaume authored Dec 2, 2021
1 parent 5395b13 commit b8afe42
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/ra-ui-materialui/src/layout/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,32 @@ const Notification = (props: NotificationProps) => {
dispatch(undo());
undoableEventEmitter.emit('end', { isUndo: true });
}, [dispatch]);

if(!notification) return null

return (
<Snackbar
open={open}
message={
notification &&
notification.message &&
otification.message &&
translate(notification.message, notification.messageArgs)
}
autoHideDuration={
(notification && notification.autoHideDuration) ||
(notification.autoHideDuration) ||
autoHideDuration
}
disableWindowBlurListener={notification && notification.undoable}
disableWindowBlurListener={notification.undoable}
TransitionProps={{ onExited: handleExited }}
onClose={handleRequestClose}
ContentProps={{
className: classnames(
styles[(notification && notification.type) || type],
styles[(notification.type) || type],
className,
{ [styles['multiLine']]: multiLine }
),
}}
action={
notification && notification.undoable ? (
notification.undoable ? (
<Button
color="primary"
className={styles.undo}
Expand Down

0 comments on commit b8afe42

Please sign in to comment.