From 4d0486e811b6907433419b289ac9bede8a6a00fa Mon Sep 17 00:00:00 2001 From: Gabriel Ribeiro Date: Thu, 26 Nov 2026 01:09:04 -0800 Subject: [PATCH] :bug: Show MCP URL copied toast only after a successful copy (#13360) The copy button for the MCP server URL in Settings > Integrations showed the "copied" toast without waiting for the clipboard write, and left the rejected promise unhandled when the write failed. Error reports show this on SaaS over HTTPS too, with NotAllowedError (write permission denied). Wait for the write, show the success toast and track the event only when it resolves, and show an error toast when it rejects, as the token copy button in the same file already does. AI-assisted-by: claude-opus-5-5 Signed-off-by: Gabriel Ribeiro <267068126+gabrielribeiro3105@users.noreply.github.com> --- .../src/app/main/ui/settings/integrations.cljs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/ui/settings/integrations.cljs b/frontend/src/app/main/ui/settings/integrations.cljs index 159dc1414b..c8c8fab46f 100644 --- a/frontend/src/app/main/ui/settings/integrations.cljs +++ b/frontend/src/app/main/ui/settings/integrations.cljs @@ -472,13 +472,17 @@ (mf/deps url) (fn [event] (dom/prevent-default event) - (clipboard/to-clipboard url) - (st/emit! (ntf/show {:level :info - :type :toast - :content (tr "integrations.notification.success.copied-link") - :timeout notification-timeout}) - (ev/event {::ev/name "copy-mcp-url" - ::ev/origin "integrations"}))))] + (-> (clipboard/to-clipboard url) + (.then (fn [_] + (st/emit! (ntf/show {:level :info + :type :toast + :content (tr "integrations.notification.success.copied-link") + :timeout notification-timeout}) + (ev/event {::ev/name "copy-mcp-url" + ::ev/origin "integrations"})))) + (.catch (fn [cause] + (st/emit! (ntf/error (or (clipboard/error-message cause) + (tr "errors.clipboard-api-unavailable")))))))))] [:section {:class (stl/css :mcp-server-section)} [:div