fix: reader not defined at page load

This commit is contained in:
Guz
2024-09-24 22:53:12 -03:00
parent 4d593595b6
commit c430ee4a5d
3 changed files with 6 additions and 2 deletions

View File

@@ -13,7 +13,7 @@
<section>
{#each data.projects as p}
<article>
<h1><a href={`/projects/${p.ID}`}>{p.Name}</a></h1>
<h1><a data-sveltekit-reload href={`/projects/${p.ID}`}>{p.Name}</a></h1>
<p class="id">{p.ID}</p>
</article>
{/each}

View File

@@ -5,6 +5,9 @@ import { db, s3, type Project } from '$lib';
import { AWS_S3_DEFAULT_BUCKET } from '$env/static/private';
import { extname } from 'node:path';
export const prerender = false;
export const ssr = false;
export const load = (async ({ params }) => {
const res = await db.get<{ id: string; name: string }>(
'SELECT ID, Name FROM projects WHERE ID = ?',

View File

@@ -67,7 +67,7 @@
background: rgbToHex(color),
current: rgbToHex(currentColor),
next: rgbToHex(nextColor),
percentage: colorPerc
percentage: Math.round(colorPerc)
},
scroll: {
current: scroll,
@@ -108,6 +108,7 @@
</dialog>
<section class="project">
<aside>
<a data-sveltekit-reload href="/" style="font-size: 0.5rem;">Return home</a>
<section>
<h1>{data.project.title}</h1>
<p class="id">{data.project.id}</p>