refactor: shared link url (#18185)

This commit is contained in:
Daniel Dietzler
2025-05-09 22:23:00 +02:00
committed by GitHub
parent ff63b0fa8f
commit 55af925ab3
7 changed files with 9 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ import { NotificationType, notificationController } from '$lib/components/shared
import { defaultLang, langs, locales } from '$lib/constants';
import { authManager } from '$lib/managers/auth-manager.svelte';
import { lang } from '$lib/stores/preferences.store';
import { serverConfig } from '$lib/stores/server-config.store';
import { handleError } from '$lib/utils/handle-error';
import {
AssetJobName,
@@ -256,8 +257,8 @@ export const copyToClipboard = async (secret: string) => {
}
};
export const makeSharedLinkUrl = (externalDomain: string, key: string) => {
return new URL(`share/${key}`, externalDomain || globalThis.location.origin).href;
export const makeSharedLinkUrl = (key: string) => {
return new URL(`share/${key}`, get(serverConfig).externalDomain || globalThis.location.origin).href;
};
export const oauth = {