Fix track coloring hover: inline reactive vars so Svelte tracks deps
statColorMode() hid hasSpeedTrack etc. from Svelte's compiler so the
{#each} block never re-rendered when timeseries loaded. Inline the
ternary directly so all reactive variables are visible to the tracker.
This commit is contained in:
@@ -407,7 +407,12 @@
|
||||
<!-- Stats panel -->
|
||||
<div class="grid grid-cols-2 lg:grid-cols-1 gap-px bg-zinc-800 rounded-xl overflow-hidden">
|
||||
{#each stats as s}
|
||||
{@const cm = statColorMode(s.key)}
|
||||
{@const cm =
|
||||
s.key === 'speed' && hasSpeedTrack ? 'speed' :
|
||||
s.key === 'heart_rate' && hasHrTrack ? 'hr' :
|
||||
s.key === 'power' && hasPowerTrack ? 'power' :
|
||||
s.key === 'elevation' && hasElevTrack ? 'elevation' :
|
||||
s.key === 'cadence' && hasCadenceTrack ? 'cadence' : null}
|
||||
<div
|
||||
class="bg-zinc-900 px-4 py-3 transition-colors"
|
||||
class:hover:bg-zinc-800={cm !== null}
|
||||
|
||||
Reference in New Issue
Block a user