Skip to content
Snippets Groups Projects
Commit 1c0c2276 authored by Sofiya Tepikin's avatar Sofiya Tepikin
Browse files

Resets the date in store for today date when navigating home

parent f789a799
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ import { ScrollView, View } from 'react-native' ...@@ -4,6 +4,7 @@ import { ScrollView, View } from 'react-native'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { navigate } from '../slices/navigation' import { navigate } from '../slices/navigation'
import { setDate } from '../slices/date'
import DripHomeIcon from '../assets/drip-home-icons' import DripHomeIcon from '../assets/drip-home-icons'
import { import {
...@@ -71,10 +72,12 @@ class Home extends Component { ...@@ -71,10 +72,12 @@ class Home extends Component {
} }
navigateToCycleDayView = () => { navigateToCycleDayView = () => {
this.props.setDate(this.todayDateString)
this.props.navigate('CycleDay') this.props.navigate('CycleDay')
} }
navigateToBleedingEditView = () => { navigateToBleedingEditView = () => {
this.props.setDate(this.todayDateString)
this.props.navigate('BleedingEditView') this.props.navigate('BleedingEditView')
} }
...@@ -157,7 +160,8 @@ class Home extends Component { ...@@ -157,7 +160,8 @@ class Home extends Component {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return({ return({
navigate: (page) => dispatch(navigate(page)) navigate: (page) => dispatch(navigate(page)),
setDate: (date) => dispatch(setDate(date)),
}) })
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment