diff --git a/src/app.d.ts b/src/app.d.ts index 9c013f3..8189cff 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,18 +1,8 @@ -// See https://kit.svelte.dev/docs/types#app -// for information about these interfaces declare global { namespace App { - // interface Error {} - // interface Locals {} interface Locals { user: User } - // interface PageData { - // theme: Theme - // } - // interface PageData {} - // interface PageState {} - // interface Platform {} } } diff --git a/src/lib/components/ThemePicker.svelte b/src/lib/components/ThemePicker.svelte index e1529da..6287fdc 100644 --- a/src/lib/components/ThemePicker.svelte +++ b/src/lib/components/ThemePicker.svelte @@ -20,10 +20,8 @@ } } - let icon = $derived.by(() => { - if (theme === "light") return "light" - if (theme === "dark") return "dark" - }) + // let icon = $derived.by(() => theme) + let icon = $derived(theme) {#key theme} diff --git a/src/lib/index.ts b/src/lib/index.ts index 3a86cfd..1ad9820 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,4 +1,3 @@ -// place files you want to import through the `$lib` alias in this folder. export type User = { username: string } diff --git a/src/routes/(auth)/login/+page.svelte b/src/routes/(auth)/login/+page.svelte index 3dd292e..237e77f 100644 --- a/src/routes/(auth)/login/+page.svelte +++ b/src/routes/(auth)/login/+page.svelte @@ -1,11 +1,9 @@ -

Login

-
diff --git a/src/routes/(auth)/register/+page.server.ts b/src/routes/(auth)/register/+page.server.ts index f88bcc1..6bff961 100644 --- a/src/routes/(auth)/register/+page.server.ts +++ b/src/routes/(auth)/register/+page.server.ts @@ -3,11 +3,6 @@ import bcrypt from "bcrypt" import { db } from "$lib/server/database" -// enum Roles { -// ADMIN = 'ADMIN', -// USER = 'USER', -// } - export const load = async ({ locals }) => { if (locals.user) { throw redirect(302, "/") @@ -42,7 +37,6 @@ export const actions = { username, passwordHash: await bcrypt.hash(password, 10), userAuthToken: crypto.randomUUID(), - // role: { connect: { name: Roles.USER } }, }, }) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 48c7849..f2055c1 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,6 +1,5 @@ diff --git a/src/service-worker.js b/src/service-worker.js index 3a3cdd5..c395d5e 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -50,18 +50,3 @@ self.addEventListener("fetch", (event) => { event.respondWith(respond()) }) - -// self.addEventListener('storage', event => { -// if (event.key === 'theme') { -// const newCacheName = event.newValue === 'dark' ? 'my-cache-dark' : 'my-cache'; - -// caches.keys().then(cacheNames => { -// return Promise.all( -// cacheNames.filter(cacheName => cacheName === CACHE) -// .map(cacheName => caches.delete(cacheName)) -// ); -// }).then(() => { -// return caches.open(newCacheName); -// }) -// } -// })