From 08fcce9e9050484d07ff684e9a6d7e10df4ebfd5 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Tue, 9 Jan 2024 23:10:06 -0500 Subject: [PATCH] fix(web): copy shared link (#6309) --- web/src/api/utils.ts | 7 +++++-- .../create-shared-link-modal.svelte | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/api/utils.ts b/web/src/api/utils.ts index 179b328f56..93ebf69b87 100644 --- a/web/src/api/utils.ts +++ b/web/src/api/utils.ts @@ -20,8 +20,11 @@ export const copyToClipboard = async (secret: string) => { }; export const makeSharedLinkUrl = (externalDomain: string, key: string) => { - const url = externalDomain || window.location.origin; - return `${url + url.endsWith('/') ? '' : '/'}share/${key}`; + let url = externalDomain || window.location.origin; + if (!url.endsWith('/')) { + url += '/'; + } + return `${url}share/${key}`; }; export const oauth = { diff --git a/web/src/lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte b/web/src/lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte index 483ed9bd28..e9fee3d375 100644 --- a/web/src/lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte +++ b/web/src/lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte @@ -94,7 +94,7 @@ return; } - await copyToClipboard(password ? `Link: ${sharedLink}\nPassword: ${password}` : sharedLink); + await copyToClipboard(sharedLink); }; const getExpirationTimeInMillisecond = () => {