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

Merge branch 'Bug-android-back-button-when-navigating-away-from-settings' into 'rebased-redesign'

Fix error occurring when navigating back from settings section

See merge request bloodyhealth/drip!319
parents 08e01346 9e907dad
No related branches found
No related tags found
No related merge requests found
...@@ -7,23 +7,15 @@ const navigationSlice = createSlice({ ...@@ -7,23 +7,15 @@ const navigationSlice = createSlice({
currentPage: 'Home', currentPage: 'Home',
}, },
reducers: { reducers: {
navigate: (state, action) => { navigate: (_state, action) => {
return { return {
currentPage: action.payload, currentPage: action.payload,
previousPage: state.currentPage,
} }
}, },
goBack: ({ currentPage, previousPage }) => { goBack: ({ currentPage }) => {
if (currentPage === 'CycleDay' && !!previousPage) {
return {
currentPage: previousPage,
}
}
const page = pages.find((p) => p.component === currentPage) const page = pages.find((p) => p.component === currentPage)
return { return {
currentPage: page.parent, currentPage: page.parent,
previousPage: currentPage,
} }
}, },
}, },
......
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