Remove blocking toasts from StartPlan

Some of these weren't extra information
and would happen too often. Toasts should
be rare and informational.
This commit is contained in:
Brandon Presley 2022-11-12 17:26:38 +13:00
parent 79296b6518
commit c70e9f5c69
1 changed files with 2 additions and 10 deletions

View File

@ -2,9 +2,9 @@ import {RouteProp, useRoute} from '@react-navigation/native'
import {useCallback, useEffect, useMemo, useRef, useState} from 'react'
import {NativeModules, TextInput, View} from 'react-native'
import {FlatList} from 'react-native-gesture-handler'
import {Button, ProgressBar} from 'react-native-paper'
import {Button} from 'react-native-paper'
import {getBestSet} from './best.service'
import {MARGIN, PADDING} from './constants'
import {PADDING} from './constants'
import CountMany from './count-many'
import {AppDataSource} from './data-source'
import {getNow, setRepo, settingsRepo} from './db'
@ -16,7 +16,6 @@ import Settings from './settings'
import StackHeader from './StackHeader'
import StartPlanItem from './StartPlanItem'
import {toast} from './toast'
import useTimer from './use-timer'
export default function StartPlan() {
const {params} = useRoute<RouteProp<PlanPageParams, 'StartPlan'>>()
@ -31,7 +30,6 @@ export default function StartPlan() {
const repsRef = useRef<TextInput>(null)
const unitRef = useRef<TextInput>(null)
const workouts = useMemo(() => params.plan.workouts.split(','), [params])
const {minutes, seconds} = useTimer()
const [selection, setSelection] = useState({
start: 0,
@ -101,7 +99,6 @@ export default function StartPlan() {
(+weight > best.weight || (+reps > best.reps && +weight === best.weight))
)
toast("Great work King! That's a new record.")
else if (!settings.alarm) return toast('Added set')
const milliseconds =
Number(best.minutes) * 60 * 1000 + Number(best.seconds) * 1000
const {vibrate, sound, noSound} = settings
@ -162,11 +159,6 @@ export default function StartPlan() {
/>
)}
</View>
<ProgressBar
visible={minutes !== '00' || seconds !== '00'}
style={{marginBottom: MARGIN}}
progress={(Number(minutes) * 60 + Number(seconds)) / 210}
/>
<Button mode="contained" icon="save" onPress={handleSubmit}>
Save
</Button>