From 12b4259a0135f897adc5b3c89598381c8e025343 Mon Sep 17 00:00:00 2001 From: zuyuanceo <70935645+caizhiqiangzeyuan@users.noreply.github.com> Date: Mon, 9 Jun 2025 07:40:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug:The=20enqueueSnackbar=20Snackbar=20no?= =?UTF-8?q?tification=20cannot=20auto-close.=20=E2=80=A6=20(#4610)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix bug:The enqueueSnackbar Snackbar notification cannot auto-close. #4608 --- packages/ui/src/store/actions.js | 5 +++++ .../ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/store/actions.js b/packages/ui/src/store/actions.js index 0c68f8f2..c6ace4a6 100644 --- a/packages/ui/src/store/actions.js +++ b/packages/ui/src/store/actions.js @@ -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() } } diff --git a/packages/ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx b/packages/ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx index 425c65aa..6495e6bf 100644 --- a/packages/ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx +++ b/packages/ui/src/ui-component/dialog/AgentflowGeneratorDialog.jsx @@ -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) => (