Merge remote-tracking branch 'mrq/13' into integrate2
This commit is contained in:
commit
1bd69c75ff
4 files changed
+135
-6
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useStore } from './store/useStore.js'
|
||||
import { useUI } from './store/useUI.js'
|
||||
import { EXDB, EXIDX, BODYPARTS, isCardio, isBodyweightEq, allExercises, equipmentOf, smOf } from './lib/exercises.js'
|
||||
import { EXDB, EXIDX, BODYPARTS, isCardio, isBodyweightEq, allExercises, equipmentOf, smOf, matchExercise } from './lib/exercises.js'
|
||||
import { fmtDate, fmtNum, fmtVol, fmtDur, durPart, todayISO, uid, exCount, DAYN, MONTHS_LONG, ACCENTS } from './lib/format.js'
|
||||
import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW, supersetUnits, unitOf, setLabel, defaultConfig, cleanupSg, modeOf, effortOf, isBw, isPerSide, sideReps, workSetsDone } from './lib/history.js'
|
||||
import { beep, vibrate } from './lib/sound.js'
|
||||
@@ -422,11 +422,10 @@ function ExercisePicker({ onPick, close }) {
|
||||
const [bp, setBp] = useState('') // '' = all, '★' = chosen, else a body part
|
||||
const [eq, setEq] = useState('') // '' = any equipment
|
||||
const [shown, setShown] = useState(50)
|
||||
const ql = q.toLowerCase().trim()
|
||||
const all = allExercises(st)
|
||||
let base = all.filter(e =>
|
||||
(bp === '★' ? usage[e.id] : (!bp || e.bp === bp)) &&
|
||||
(!ql || e.n.toLowerCase().includes(ql) || e.tg.includes(ql) || e.eq.includes(ql) || (e.desc || '').toLowerCase().includes(ql)))
|
||||
matchExercise(e, q))
|
||||
if (bp === '★') base = [...base].sort((a, b) => (usage[b.id] - usage[a.id]) || (a.n < b.n ? -1 : 1))
|
||||
const eqOpts = equipmentOf(base)
|
||||
// Drop the equipment filter if the search narrowed it away, so you never hit a dead end.
|
||||
|
||||
Reference in new issue
Block a user