Fix edit set crashing on fresh installs
This commit is contained in:
parent
aa2d146527
commit
09e178c5ce
|
@ -21,14 +21,14 @@ export default function SetForm({
|
||||||
settings: Settings
|
settings: Settings
|
||||||
}) {
|
}) {
|
||||||
const [name, setName] = useState(set.name)
|
const [name, setName] = useState(set.name)
|
||||||
const [reps, setReps] = useState(set.reps.toString())
|
const [reps, setReps] = useState(set.reps?.toString())
|
||||||
const [weight, setWeight] = useState(set.weight.toString())
|
const [weight, setWeight] = useState(set.weight?.toString())
|
||||||
const [newImage, setNewImage] = useState(set.image)
|
const [newImage, setNewImage] = useState(set.image)
|
||||||
const [unit, setUnit] = useState(set.unit)
|
const [unit, setUnit] = useState(set.unit)
|
||||||
const [showRemove, setShowRemove] = useState(false)
|
const [showRemove, setShowRemove] = useState(false)
|
||||||
const [selection, setSelection] = useState({
|
const [selection, setSelection] = useState({
|
||||||
start: 0,
|
start: 0,
|
||||||
end: set.reps.toString().length,
|
end: set.reps?.toString().length,
|
||||||
})
|
})
|
||||||
const [removeImage, setRemoveImage] = useState(false)
|
const [removeImage, setRemoveImage] = useState(false)
|
||||||
const weightRef = useRef<TextInput>(null)
|
const weightRef = useRef<TextInput>(null)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user