fixes stats page activity limit
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
import * as M from "maplibre-gl";
|
||||
import { _ } from "svelte-i18n";
|
||||
import MapWithElevationMaplibre from "../trail/map_with_elevation_maplibre.svelte";
|
||||
import { fetchGPX } from "$lib/stores/trail_store";
|
||||
|
||||
interface Props {
|
||||
summitLogs?: SummitLog[];
|
||||
@@ -41,10 +42,14 @@
|
||||
|
||||
async function openMap(log: SummitLog) {
|
||||
if (!log.expand?.gpx_data) {
|
||||
return;
|
||||
const gpxData: string = await fetchGPX(log as any, fetch);
|
||||
log.expand = {
|
||||
...(log.expand ?? {}),
|
||||
gpx_data: gpxData,
|
||||
};
|
||||
}
|
||||
|
||||
trail = (await gpx2trail(log.expand.gpx_data)).trail;
|
||||
trail = (await gpx2trail(log.expand.gpx_data!)).trail;
|
||||
trail.id = log.id;
|
||||
trail.expand!.gpx_data = log.expand.gpx_data;
|
||||
|
||||
@@ -124,10 +129,7 @@
|
||||
{#snippet content()}
|
||||
<div id="summit-log-table-map" class="h-[32rem]">
|
||||
{#if trail}
|
||||
<MapWithElevationMaplibre
|
||||
trails={[trail]}
|
||||
bind:map
|
||||
showTerrain
|
||||
<MapWithElevationMaplibre trails={[trail]} bind:map showTerrain
|
||||
></MapWithElevationMaplibre>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
</p>
|
||||
</td>
|
||||
{/if}
|
||||
{#if showRoute && log.expand?.gpx_data}
|
||||
{#if showRoute && log.gpx}
|
||||
<td>
|
||||
<button
|
||||
aria-label="Open route"
|
||||
|
||||
@@ -15,6 +15,7 @@ export async function summit_logs_index(author: string, filter?: SummitLogFilter
|
||||
|
||||
const r = await f('/api/v1/summit-log?' + new URLSearchParams({
|
||||
filter: filterText,
|
||||
perPage: "-1",
|
||||
expand: "trails_via_summit_logs.category",
|
||||
sort: "+date",
|
||||
}), {
|
||||
@@ -28,17 +29,17 @@ export async function summit_logs_index(author: string, filter?: SummitLogFilter
|
||||
|
||||
const fetchedSummitLogs: ListResult<SummitLog> = await r.json();
|
||||
|
||||
for (const log of fetchedSummitLogs.items) {
|
||||
if (!log.gpx) {
|
||||
continue
|
||||
}
|
||||
const gpxData: string = await fetchGPX(log as any, f);
|
||||
// for (const log of fetchedSummitLogs.items) {
|
||||
// if (!log.gpx) {
|
||||
// continue
|
||||
// }
|
||||
// const gpxData: string = await fetchGPX(log as any, f);
|
||||
|
||||
if (!log.expand) {
|
||||
log.expand = {};
|
||||
}
|
||||
log.expand.gpx_data = gpxData;
|
||||
}
|
||||
// if (!log.expand) {
|
||||
// log.expand = {};
|
||||
// }
|
||||
// log.expand.gpx_data = gpxData;
|
||||
// }
|
||||
|
||||
summitLogs.set(fetchedSummitLogs.items);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user