We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaf18ce commit 87f74b6Copy full SHA for 87f74b6
1 file changed
packages/ra-ui-materialui/src/layout/Notification.tsx
@@ -44,12 +44,12 @@ export const Notification = (props: NotificationProps) => {
44
45
useEffect(() => {
46
const beforeunload = (e: BeforeUnloadEvent) => {
47
- if (messageInfo?.notificationOptions?.undoable) {
48
- e.preventDefault();
49
- }
+ e.preventDefault();
50
};
51
52
- window.addEventListener('beforeunload', beforeunload);
+ if (messageInfo?.notificationOptions?.undoable) {
+ window.addEventListener('beforeunload', beforeunload);
+ }
53
54
if (notifications.length && !messageInfo) {
55
// Set a new snack when we don't have an active one
0 commit comments