Fix critical error

This commit is contained in:
Sean Morley
2024-07-29 22:14:42 -04:00
parent 103500b5e1
commit f98ca62aad
3 changed files with 29 additions and 2 deletions

View File

@@ -33,7 +33,8 @@ export const load = (async (event) => {
return {
lngLat: [adventure.longitude, adventure.latitude] as [number, number],
name: adventure.name,
type: adventure.type
type: adventure.type,
collection: adventure.collection
};
});

View File

@@ -19,6 +19,7 @@
let showVisited = true;
let showPlanned = true;
let showCollectionAdventures = false;
$: {
if (!showVisited) {
@@ -33,6 +34,12 @@
const plannedMarkers = data.props.markers.filter((marker) => marker.type === 'planned');
markers = [...markers, ...plannedMarkers];
}
if (!showCollectionAdventures) {
markers = markers.filter((marker) => marker.collection === null);
} else {
const collectionMarkers = data.props.markers.filter((marker) => marker.collection !== null);
markers = [...markers, ...collectionMarkers];
}
}
let newMarker = [];
@@ -117,6 +124,14 @@
<span class="label-text">Planned</span>
<input type="checkbox" bind:checked={showPlanned} class="checkbox checkbox-primary" />
</label>
<label class="label cursor-pointer">
<span class="label-text">Collection Adventures</span>
<input
type="checkbox"
bind:checked={showCollectionAdventures}
class="checkbox checkbox-primary"
/>
</label>
{#if newMarker.length > 0}
<button type="button" class="btn btn-primary mb-2" on:click={() => (createModalOpen = true)}