mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: update Navbar and layout server to improve structure and data handling
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
: '';
|
: '';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="fixed top-0 left-0 z-100 h-15 w-full bg-neutral-900">
|
<div class="z-100 h-15 w-full bg-neutral-900">
|
||||||
<div class="mx-auto flex h-15 max-w-5xl items-center px-4 py-2">
|
<div class="mx-auto flex h-15 max-w-5xl items-center px-4 py-2">
|
||||||
<a href={resolve('/')} class="text-xl font-bold text-white hover:text-neutral-300">Sharpbin</a>
|
<a href={resolve('/')} class="text-xl font-bold text-white hover:text-neutral-300">Sharpbin</a>
|
||||||
{#if $user}
|
{#if $user}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import type { LayoutServerLoad } from './$types';
|
import type { LayoutServerLoad } from './$types';
|
||||||
|
|
||||||
export const load: LayoutServerLoad = async ({ fetch }) => {
|
export const load: LayoutServerLoad = async ({ fetch, url }) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch('/api/auth/info');
|
const res = await fetch('/api/auth/info');
|
||||||
const options = await res.json();
|
const options = await res.json();
|
||||||
return { options };
|
return { options , url: url.href };
|
||||||
} catch {
|
} catch {
|
||||||
return { options: null };
|
return { options: null, url: url.href };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user