mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 03:01:10 +03:00
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:
@@ -32,6 +32,11 @@ export const enqueueSnackbar = (notification) => {
|
|||||||
type: ENQUEUE_SNACKBAR,
|
type: ENQUEUE_SNACKBAR,
|
||||||
notification: {
|
notification: {
|
||||||
...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()
|
key: key || new Date().getTime() + Math.random()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ const AgentflowGeneratorDialog = ({ show, dialogProps, onCancel, onConfirm }) =>
|
|||||||
options: {
|
options: {
|
||||||
key: new Date().getTime() + Math.random(),
|
key: new Date().getTime() + Math.random(),
|
||||||
variant: 'error',
|
variant: 'error',
|
||||||
persist: true,
|
persist: false,
|
||||||
action: (key) => (
|
action: (key) => (
|
||||||
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
|
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
|
||||||
<IconX />
|
<IconX />
|
||||||
@@ -146,7 +146,7 @@ const AgentflowGeneratorDialog = ({ show, dialogProps, onCancel, onConfirm }) =>
|
|||||||
options: {
|
options: {
|
||||||
key: new Date().getTime() + Math.random(),
|
key: new Date().getTime() + Math.random(),
|
||||||
variant: 'error',
|
variant: 'error',
|
||||||
persist: true,
|
persist: false,
|
||||||
action: (key) => (
|
action: (key) => (
|
||||||
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
|
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
|
||||||
<IconX />
|
<IconX />
|
||||||
|
|||||||
Reference in New Issue
Block a user