coyotte508 HF staff commited on
Commit
b6d3624
β€’
1 Parent(s): cf76556

Revert "πŸ› Workaround to sveltekit's bug"

Browse files

This reverts commit 2f84eb7bbe33028fa3685de84cc60d6e86f0ce7c.

src/routes/+layout.svelte CHANGED
@@ -10,9 +10,8 @@
10
 
11
  export let data: LayoutData;
12
 
13
- // See https://github.com/sveltejs/kit/issues/8272 for the reason why we can't just $page.data?.pictures
14
- $: pictures = ($page.data?.page?.pictures as typeof data.pictures) ?? data.pictures;
15
- $: shownPicture = pictures.find((p) => p.storage[0].width >= p.storage[0].height) ?? pictures[0];
16
 
17
  let menuOpen = false;
18
  let date = new Date();
 
10
 
11
  export let data: LayoutData;
12
 
13
+ $: shownPicture =
14
+ data.pictures.find((p) => p.storage[0].width >= p.storage[0].height) ?? data.pictures[0];
 
15
 
16
  let menuOpen = false;
17
  let date = new Date();
src/routes/vente/[id]/+page.server.ts CHANGED
@@ -21,9 +21,7 @@ export const load: PageServerLoad = async (input) => {
21
  product,
22
  title: `${product.name} - ${product.price} €`,
23
  description: product.description,
24
- page: {
25
- pictures: product.photos
26
- },
27
  type: 'og:product',
28
  price: product.price
29
  };
 
21
  product,
22
  title: `${product.name} - ${product.price} €`,
23
  description: product.description,
24
+ pictures: product.photos,
 
 
25
  type: 'og:product',
26
  price: product.price
27
  };