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 = () => {