aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/About.svelte16
-rw-r--r--src/routes/(app)/locations/+server.js12
-rw-r--r--src/routes/+page.svelte5
3 files changed, 21 insertions, 12 deletions
diff --git a/src/components/About.svelte b/src/components/About.svelte
index 317c190e..c05f2dc2 100644
--- a/src/components/About.svelte
+++ b/src/components/About.svelte
@@ -85,10 +85,12 @@
</div>
</div>
-<div>
- <h3 class="text-5xl font-medium mb-5 text-center">{$t('about.locations.header')}</h3>
- <p class="text-secondary text-xl w-full md:w-10/12 lg:w-2/3 2xl:w-[800px] mx-auto mb-10">
- {@html $t('about.locations.description')}
- </p>
- <LocationsMap {locations} />
-</div>
+{#if locations?.length}
+ <div>
+ <h3 class="text-5xl font-medium mb-5 text-center">{$t('about.locations.header')}</h3>
+ <p class="text-secondary text-xl w-full md:w-10/12 lg:w-2/3 2xl:w-[800px] mx-auto mb-10">
+ {@html $t('about.locations.description')}
+ </p>
+ <LocationsMap {locations} />
+ </div>
+{/if}
diff --git a/src/routes/(app)/locations/+server.js b/src/routes/(app)/locations/+server.js
index 87f8975d..dd9e984b 100644
--- a/src/routes/(app)/locations/+server.js
+++ b/src/routes/(app)/locations/+server.js
@@ -2,6 +2,14 @@ import { get } from '$lib/utils';
import { json } from '@sveltejs/kit';
export async function GET({ fetch, setHeaders }) {
- setHeaders({ 'cache-control': 'public, max-age=600' });
- return json(await get('/locations'));
+ let locations = [];
+
+ try {
+ ({ locations } = await get('/locations'));
+ setHeaders({ 'cache-control': 'public, max-age=600' });
+ } catch (e) {
+ console.log('failed to fetch locations');
+ }
+
+ return json({ locations });
}
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index dd135b1b..bf191b7f 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -17,6 +17,7 @@
export let data;
let { user } = data;
let { locations } = data;
+ console.log('LOCATIONS', locations);
let howItWorks;
let faq;
@@ -93,9 +94,7 @@
<div bind:this={about} />
</div>
- {#if locations?.length}
- <About {locations} />
- {/if}
+ <About {locations} />
</main>
<Footer />