feat: navigate to exercise screen
This commit is contained in:
parent
2902b317b6
commit
91d5202898
1 changed files with 4 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import { ScrollView, TouchableOpacity } from 'react-native';
|
|||
import { api } from '@services/api';
|
||||
import { AppError } from '@utils/AppError';
|
||||
import { ExerciseDTO } from '@dtos/ExerciseDTO';
|
||||
import { AppNavigatorRoutesProps } from '@routes/app.routes';
|
||||
|
||||
import BodySvg from '@assets/body.svg';
|
||||
import SeriesSvg from '@assets/series.svg';
|
||||
|
|
@ -26,7 +27,7 @@ export function Exercise() {
|
|||
|
||||
const [exercise, setExercise] = useState<ExerciseDTO>({} as ExerciseDTO);
|
||||
|
||||
const navigation = useNavigation();
|
||||
const navigation = useNavigation<AppNavigatorRoutesProps>();
|
||||
const toast = useToast();
|
||||
|
||||
const route = useRoute();
|
||||
|
|
@ -73,6 +74,8 @@ export function Exercise() {
|
|||
/>
|
||||
),
|
||||
});
|
||||
|
||||
navigation.navigate('History');
|
||||
} catch (error) {
|
||||
const isAppError = error instanceof AppError;
|
||||
const title = isAppError ? error.message : 'Não foi possível registrar o exercício.';
|
||||
|
|
|
|||
Loading…
Reference in a new issue