Skip to content

Commit

Permalink
Merge pull request #1028 from tomivm/fix/notification-bug
Browse files Browse the repository at this point in the history
fix Notification permanence on dom after hide.
  • Loading branch information
martinbedouret authored Sep 3, 2021
2 parents d21cefa + 2d4d82d commit b66c7a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/components/Notifications/Notifications.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const propTypes = {
handleNotificationDismissal: PropTypes.func.isRequired,
message: PropTypes.string.isRequired,
open: PropTypes.bool.isRequired,
kind: PropTypes.string,
showQueuedNotificationIfAny: PropTypes.func.isRequired
kind: PropTypes.string
};

function onRefreshPage() {
Expand All @@ -25,8 +24,7 @@ const Notifications = ({
handleNotificationDismissal,
message,
open,
kind,
showQueuedNotificationIfAny
kind
}) => (
<Snackbar
{...config}
Expand All @@ -35,11 +33,6 @@ const Notifications = ({
variant: 'elevation',
'aria-describedby': 'message-id'
}}
TransitionProps={{
// show any queued notifications after the
// present one transitions out
onExited: showQueuedNotificationIfAny
}}
message={<span id="message-id">{message}</span>}
autoHideDuration={NOTIFICATION_DELAY}
onClose={handleNotificationDismissal}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Notifications/Notifications.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class NotificationsContainer extends Component {
return;
}
hideNotification();
this.showQueuedNotificationIfAny();
};

showQueuedNotificationIfAny = () => {
Expand Down Expand Up @@ -99,7 +100,6 @@ class NotificationsContainer extends Component {
message={message}
kind={kind}
handleNotificationDismissal={this.handleNotificationDismissal}
showQueuedNotificationIfAny={this.showQueuedNotificationIfAny}
/>
);
}
Expand Down

0 comments on commit b66c7a3

Please sign in to comment.