From 701add841618f48eda933c22e9226a8a237e12a6 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Wed, 21 Sep 2022 14:02:46 -0400 Subject: [PATCH] 19567: fix missing url origin in copy-to-clipboard for local resources Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- src/store/open-in-new-tab/open-in-new-tab.actions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store/open-in-new-tab/open-in-new-tab.actions.ts b/src/store/open-in-new-tab/open-in-new-tab.actions.ts index c465aae8..6b9db6a5 100644 --- a/src/store/open-in-new-tab/open-in-new-tab.actions.ts +++ b/src/store/open-in-new-tab/open-in-new-tab.actions.ts @@ -21,7 +21,9 @@ export const copyToClipboardAction = (resource: any) => (dispatch: Dispatch, get // Copy to clipboard omits token to avoid accidental sharing const url = getNavUrl(resource.uuid, getState().auth, false); - if (url) { + if (url[0] === '/') { + copy(`${window.location.origin}${url}`); + } else if (url.length) { copy(url); } }; -- 2.39.5