From c5951886c9b1af4da1697090cf2186a628a25457 Mon Sep 17 00:00:00 2001 From: mintsweet <0x1304570@gmail.com> Date: Sat, 11 May 2024 17:27:07 +1200 Subject: [PATCH] fix: error id for scope config changed --- config-ui/src/plugins/components/scope-config/index.tsx | 6 +++--- config-ui/src/routes/connection/connection.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config-ui/src/plugins/components/scope-config/index.tsx b/config-ui/src/plugins/components/scope-config/index.tsx index 0487536b285..303191aa5bf 100644 --- a/config-ui/src/plugins/components/scope-config/index.tsx +++ b/config-ui/src/plugins/components/scope-config/index.tsx @@ -38,7 +38,7 @@ interface Props { scopeName: string; id?: ID; name?: string; - onSuccess?: (id?: ID, hideToast?: boolean) => void; + onSuccess?: (id?: ID) => void; } export const ScopeConfig = ({ plugin, connectionId, scopeId, scopeName, id, name, onSuccess }: Props) => { @@ -83,13 +83,13 @@ export const ScopeConfig = ({ plugin, connectionId, scopeId, scopeName, id, name if (success) { handleHideDialog(); - onSuccess?.(id, type === 'duplicate'); + onSuccess?.(trId); } }; const handleUpdate = (trId: ID) => { handleHideDialog(); - onSuccess?.(id); + onSuccess?.(trId); }; return ( diff --git a/config-ui/src/routes/connection/connection.tsx b/config-ui/src/routes/connection/connection.tsx index e6b2915897e..74533aa54f1 100644 --- a/config-ui/src/routes/connection/connection.tsx +++ b/config-ui/src/routes/connection/connection.tsx @@ -241,7 +241,7 @@ export const Connection = () => { } }; - const handleScopeConfigChange = async (scopeConfigId?: ID, hideToast?: boolean) => { + const handleScopeConfigChange = async (scopeConfigId?: ID) => { if (!scopeConfigId) { setVersion(version + 1); return; @@ -250,7 +250,7 @@ export const Connection = () => { const [success, res] = await operator(() => API.scopeConfig.check(plugin, scopeConfigId), { hideToast: true }); if (success) { - if (!res.projects || hideToast) { + if (!res.projects) { setVersion(version + 1); return; }