From 726aa60a06edb39a2176a576f99a15bb69402bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Sun, 24 Oct 2021 15:30:06 +0200 Subject: [PATCH] Cleanup Photos page code --- src/routes/photos.svelte | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/routes/photos.svelte b/src/routes/photos.svelte index abb9fdd..a530f10 100644 --- a/src/routes/photos.svelte +++ b/src/routes/photos.svelte @@ -7,7 +7,6 @@ import { quartOut } from 'svelte/easing' import dayjs from 'dayjs' import relativeTime from 'dayjs/plugin/relativeTime.js' - import { getAssetUrlKey } from '$utils/helpers' import { map, lerp, throttle } from '$utils/functions' // Components import Metas from '$components/Metas.svelte' @@ -33,7 +32,10 @@ let scrollY: number let innerWidth: number, innerHeight: number - // Filters + + /** + * Filters + */ const urlFiltersParams = new URLSearchParams() let filtered: boolean let filterCountry: any = $page.query.get('country') || defaultCountry @@ -68,7 +70,7 @@ /** - * Define URL params + * Handle URL query params */ $: countryFlagId = currentCountry ? currentCountry.flag.id : undefined @@ -103,7 +105,7 @@ /** - * Select change events + * Filters change events */ // Country select const handleCountryChange = ({ detail: value }) => { @@ -126,7 +128,7 @@ * Load photos */ // [function] Load photos helper - const loadPhotos = async (page?: number) => { + const loadPhotos = async (page: number) => { const res = fetchAPI(` query { photos: photo (