fix bug:The enqueueSnackbar Snackbar notification cannot auto-close. … (#4610)

fix bug:The enqueueSnackbar Snackbar notification cannot auto-close. #4608
This commit is contained in:
zuyuanceo
2025-06-09 07:40:20 +08:00
committed by GitHub
parent 2387a06ce4
commit 12b4259a01
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -32,6 +32,11 @@ export const enqueueSnackbar = (notification) => {
type: ENQUEUE_SNACKBAR,
notification: {
...notification,
options: {
...notification.options,
persist: notification.options?.persist ?? false, // Default: auto-close enabled
autoHideDuration: notification.options?.autoHideDuration ?? 5000 // Default auto-close duration: 5 seconds
},
key: key || new Date().getTime() + Math.random()
}
}
@@ -131,7 +131,7 @@ const AgentflowGeneratorDialog = ({ show, dialogProps, onCancel, onConfirm }) =>
options: {
key: new Date().getTime() + Math.random(),
variant: 'error',
persist: true,
persist: false,
action: (key) => (
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
<IconX />
@@ -146,7 +146,7 @@ const AgentflowGeneratorDialog = ({ show, dialogProps, onCancel, onConfirm }) =>
options: {
key: new Date().getTime() + Math.random(),
variant: 'error',
persist: true,
persist: false,
action: (key) => (
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
<IconX />