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({
currentPage: 'Home',
},
reducers: {
navigate: (state, action) => {
navigate: (_state, action) => {
return {
currentPage: action.payload,
previousPage: state.currentPage,
}
},
goBack: ({ currentPage, previousPage }) => {
if (currentPage === 'CycleDay' && !!previousPage) {
return {
currentPage: previousPage,
}
}
goBack: ({ currentPage }) => {
const page = pages.find((p) => p.component === currentPage)
return {
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