small nit BASE_URL

This commit is contained in:
Ruben Fiszel
2024-07-22 19:56:26 +02:00
parent 00541e8218
commit 3cc5df716c
+4 -3
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)
}
}