small nit BASE_URL

This commit is contained in:
Ruben Fiszel
2024-07-22 19:56:26 +02:00
parent a15138d811
commit 829ee8a46a

View File

@@ -1,11 +1,12 @@
import { goto as svelteGoto } from '$app/navigation'
import { base } from '$app/paths'
import { base as svelteBase } from '$app/paths'
export { base } from '$lib/base'
export function goto(path, options = {}) {
if (base == '') {
if (svelteBase == '') {
return svelteGoto(path, options)
} else {
const fullPath = path.startsWith(base) ? path : `${base}${path}`
const fullPath = path.startsWith(svelteBase) ? path : `${svelteBase}${path}`
return svelteGoto(fullPath, options)
}
}