Ensure reps are always positive - 2.15 🚀
This commit is contained in:
parent
1921ecb9f4
commit
9c3d6772a9
|
@ -239,9 +239,11 @@ export default function EditSet() {
|
|||
value={reps}
|
||||
onChangeText={(newReps) => {
|
||||
const fixed = fixNumeric(newReps);
|
||||
setReps(fixed);
|
||||
setReps(fixed.replace(/-/g, ''))
|
||||
if (fixed.length !== newReps.length)
|
||||
toast("Reps must be a number");
|
||||
else if (fixed.includes('-'))
|
||||
toast("Reps must be a positive value")
|
||||
}}
|
||||
onSubmitEditing={() => weightRef.current?.focus()}
|
||||
selection={selection}
|
||||
|
|
11
EditSets.tsx
11
EditSets.tsx
|
@ -21,6 +21,8 @@ import { DrawerParams } from "./drawer-params";
|
|||
import GymSet from "./gym-set";
|
||||
import Settings from "./settings";
|
||||
import PrimaryButton from "./PrimaryButton";
|
||||
import { fixNumeric } from "./fix-numeric";
|
||||
import { toast } from "./toast";
|
||||
|
||||
export default function EditSets() {
|
||||
const { params } = useRoute<RouteProp<StackParams, "EditSets">>();
|
||||
|
@ -98,7 +100,14 @@ export default function EditSets() {
|
|||
label={`Reps: ${oldReps}`}
|
||||
keyboardType="numeric"
|
||||
value={reps}
|
||||
onChangeText={setReps}
|
||||
onChangeText={(newReps) => {
|
||||
const fixed = fixNumeric(newReps);
|
||||
setReps(fixed.replace(/-/g, ''))
|
||||
if (fixed.length !== newReps.length)
|
||||
toast("Reps must be a number");
|
||||
else if (fixed.includes('-'))
|
||||
toast("Reps must be a positive value")
|
||||
}}
|
||||
selection={selection}
|
||||
onSelectionChange={(e) => setSelection(e.nativeEvent.selection)}
|
||||
autoFocus={!!name}
|
||||
|
|
|
@ -150,9 +150,11 @@ export default function StartPlan() {
|
|||
value={reps}
|
||||
onChangeText={(newReps) => {
|
||||
const fixed = fixNumeric(newReps);
|
||||
setReps(fixed);
|
||||
setReps(fixed.replace(/-/g, ''))
|
||||
if (fixed.length !== newReps.length)
|
||||
toast("Reps must be a number");
|
||||
else if (fixed.includes('-'))
|
||||
toast("Reps must be a positive value")
|
||||
}}
|
||||
onSubmitEditing={() => weightRef.current?.focus()}
|
||||
selection={selection}
|
||||
|
|
|
@ -85,8 +85,8 @@ android {
|
|||
applicationId "com.massive"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 36229
|
||||
versionName "2.14"
|
||||
versionCode 36230
|
||||
versionName "2.15"
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "massive",
|
||||
"version": "2.14",
|
||||
"version": "2.15",
|
||||
"private": true,
|
||||
"license": "GPL-3.0-only",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue