File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1- import type { Admin , Record } from 'pocketbase'
1+ import type { AuthModel } from 'pocketbase'
22import { writable } from 'svelte/store'
33
4- export const currentUser = writable < Record | Admin | null > ( )
4+ export const currentUser = writable < AuthModel | null > ( )
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import ' ../app.postcss'
33
4+ import type { Snippet } from ' svelte'
45 import { applyAction , enhance } from ' $app/forms'
56 import { pb } from ' $lib/pocketbase'
67 import { currentUser } from ' $lib/stores/user'
78 import type { PageData } from ' ./$types'
89
9- export let data: PageData
10+ interface Props {
11+ data: PageData
12+ children? : Snippet
13+ }
14+
15+ let { data, children }: Props = $props ()
1016
1117 // Set the current user from the data passed in from the server
12- $ : currentUser .set (data .user )
18+ $effect (() => {
19+ currentUser .set (data .user )
20+ })
1321 </script >
1422
1523<div class =" bg-neutral text-neutral-content" >
4553</div >
4654
4755<div class =" max-w-xl mx-auto py-8 px-4" >
48- < slot />
56+ {@ render children ?.()}
4957</div >
You can’t perform that action at this time.
0 commit comments