diff --git a/site/src/components/AthleteView.svelte b/site/src/components/AthleteView.svelte
index 597f978..dc10fbc 100644
--- a/site/src/components/AthleteView.svelte
+++ b/site/src/components/AthleteView.svelte
@@ -33,6 +33,8 @@
let segmentSummary: SegmentSummaryItem[] = [];
let segmentsLoading = false;
let segmentsHandle = '';
+ let rescanning = false;
+ let rescanMsg: string | null = null;
const editUrl = import.meta.env.PUBLIC_EDIT_URL ?? '';
const editEnabled = editUrl !== '' || import.meta.env.PUBLIC_EDIT_ENABLED === 'true';
@@ -177,6 +179,29 @@
{:else if activeTab === 'segments'}
+
+
+
+ {#if rescanMsg}{rescanMsg}{/if}
+
+
+
{#if segmentsLoading}
Loading segments…
{:else if segmentSummary.length === 0}
diff --git a/site/src/components/SegmentsView.svelte b/site/src/components/SegmentsView.svelte
index cb5c326..d0a2173 100644
--- a/site/src/components/SegmentsView.svelte
+++ b/site/src/components/SegmentsView.svelte
@@ -23,8 +23,6 @@
let loading = false;
let selectedId: string | null = null;
let fetchTimer: ReturnType | null = null;
- let rescanning = false;
- let rescanMsg: string | null = null;
const TILE_STYLE = 'https://tiles.openfreemap.org/styles/positron';
const SEG_COLOR = '#f59e0b';
@@ -125,20 +123,6 @@
['case', ['==', ['get', 'id'], selectedId ?? ''], 5, 3]);
}
- async function rescanAll() {
- rescanning = true;
- rescanMsg = null;
- try {
- const r = await fetch('/api/me/segment-rescan', { method: 'POST', credentials: 'include' });
- const d = await r.json();
- if (r.ok) rescanMsg = `Found ${d.efforts_found} effort${d.efforts_found !== 1 ? 's' : ''}.`;
- else rescanMsg = d.detail ?? 'Rescan failed.';
- } catch {
- rescanMsg = 'Could not reach server.';
- }
- rescanning = false;
- }
-
async function deleteSegment(id: string) {
if (!confirm('Delete this segment? This cannot be undone.')) return;
try {
@@ -160,21 +144,10 @@