diff --git a/EditPlan.tsx b/EditPlan.tsx index 30357b0..2f24349 100644 --- a/EditPlan.tsx +++ b/EditPlan.tsx @@ -12,7 +12,12 @@ import { StyleSheet, View, } from "react-native"; -import { IconButton, Switch as PaperSwitch, Text } from "react-native-paper"; +import { + Button, + IconButton, + Switch as PaperSwitch, + Text, +} from "react-native-paper"; import AppInput from "./AppInput"; import { StackParams } from "./AppStack"; import PrimaryButton from "./PrimaryButton"; @@ -23,6 +28,7 @@ import { DAYS } from "./days"; import { planRepo, setRepo } from "./db"; import { DrawerParams } from "./drawer-params"; import GymSet, { defaultSet } from "./gym-set"; +import { toast } from "./toast"; export default function EditPlan() { const { params } = useRoute>(); @@ -62,12 +68,13 @@ export default function EditPlan() { if (!days || !exercises) return; const newExercises = exercises.filter((exercise) => exercise).join(","); const newDays = days.filter((day) => day).join(","); - await planRepo.save({ + const saved = await planRepo.save({ title: title, days: newDays, exercises: newExercises, id: plan.id, }); + if (saved.id === 1) toast("Tap your plan again to begin using it"); }, [title, days, exercises, plan]); const toggleExercise = useCallback( @@ -185,6 +192,19 @@ export default function EditPlan() { {exercises.map((exercise, index) => renderExercise(exercise, index, true) )} + {names?.length === 0 && ( + <> + No exercises yet. + + + )} {names !== undefined && names .filter((name) => !exercises.includes(name)) diff --git a/android/app/build.gradle b/android/app/build.gradle index e6c6095..b809713 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -85,8 +85,8 @@ android { applicationId "com.massive" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 36223 - versionName "2.8" + versionCode 36224 + versionName "2.9" } signingConfigs { release { diff --git a/package.json b/package.json index cfa6ce6..3c9e65b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "massive", - "version": "2.8", + "version": "2.9", "private": true, "license": "GPL-3.0-only", "scripts": {