Code clean,
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
description
|
||||
explore_globe
|
||||
explore_list
|
||||
homepage_photos_limit
|
||||
photos_per_page
|
||||
instagram
|
||||
seo_name
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script context="module">
|
||||
// Variables
|
||||
let limit
|
||||
let limit = process.env.CONFIG.HOME_PHOTOS_LIMIT
|
||||
|
||||
// Preload data (photos to display)
|
||||
export async function preload (page, session) {
|
||||
@@ -11,12 +11,9 @@
|
||||
]
|
||||
// Random sort
|
||||
const sort = '?'
|
||||
// Get the limit from API
|
||||
site.subscribe(store => limit = store.homepage_photos_limit)
|
||||
|
||||
const req = await this.fetch(`${apiEndpoints.rest}/items/photos?fields=${fields.join()}&sort=${sort}&limit=${limit}`)
|
||||
const photos = await req.json()
|
||||
if (req.ok) {
|
||||
if (req.ok) {
|
||||
return { photos: photos.data }
|
||||
}
|
||||
this.error(404, 'Not found')
|
||||
@@ -103,10 +100,8 @@
|
||||
</div>
|
||||
|
||||
<div id="intro-carousel">
|
||||
{#if photos}
|
||||
<Carousel {photos} />
|
||||
<Fullscreen />
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user