mirror of
https://github.com/imputnet/cobalt.git
synced 2025-12-12 05:29:54 +00:00
15 lines
460 B
TypeScript
15 lines
460 B
TypeScript
import env from "$lib/env";
|
|
import { get } from "svelte/store";
|
|
import settings from "$lib/state/settings";
|
|
|
|
export const currentApiURL = () => {
|
|
const processingSettings = get(settings).processing;
|
|
const customInstanceURL = processingSettings.customInstanceURL;
|
|
|
|
if (processingSettings.enableCustomInstances && customInstanceURL.length > 0) {
|
|
return new URL(customInstanceURL).origin;
|
|
}
|
|
|
|
return new URL(env.DEFAULT_API!).origin;
|
|
}
|