From 6465fd421272c90ae3e00f546c6ad0bc06e4024d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 14 Dec 2023 14:53:28 -0500 Subject: [PATCH] make visited a boolean --- .../03-sveltekit/04-headers-and-cookies/02-cookies/README.md | 4 ++-- .../02-cookies/app-a/src/routes/+page.server.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/README.md b/content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/README.md index 252008899..156b748f6 100644 --- a/content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/README.md +++ b/content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/README.md @@ -12,7 +12,7 @@ export function load(+++{ cookies }+++) { +++const visited = cookies.get('visited');+++ return { - visited + visited: visited === 'true' }; } ``` @@ -27,7 +27,7 @@ export function load({ cookies }) { +++cookies.set('visited', 'true', { path: '/' });+++ return { - visited + visited: visited === 'true' }; } ``` diff --git a/content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/app-a/src/routes/+page.server.js b/content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/app-a/src/routes/+page.server.js index 4be89201b..19467be55 100644 --- a/content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/app-a/src/routes/+page.server.js +++ b/content/tutorial/03-sveltekit/04-headers-and-cookies/02-cookies/app-a/src/routes/+page.server.js @@ -1,7 +1,7 @@ export function load() { - const visited = false; + const visited = 'false'; return { - visited + visited: visited === 'true' }; }